添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
2. IsEnabled
I want to bind each toggle button's IsEnabled to DataTable
for example if a toggle button's content is "Test" and there is row in
datatable with {Test,True}, this radio button's IsEnabled marks as True. You can use the indexers of the table and its rows in XAML. For example:
DataTable dt = new DataTable();
dt.Columns.Add( "Name" , typeof ( string ));
dt.Columns.Add( "IsEnabled" , typeof ( bool ));
dt.Rows.Add( "Button 1" , true );
dt.Rows.Add( "Button 2" , false );
this .DataContext = dt;
< StackPanel >
< telerik:RadToggleButton Content = "{Binding Rows[0][Name]}" IsEnabled = "{Binding Rows[0][IsEnabled]}" />
< telerik:RadToggleButton Content = "{Binding Rows[1][Name]}" IsEnabled = "{Binding Rows[1][IsEnabled]}" />
</ StackPanel >
I hope that helps.
Regards,
Martin Ivanov
Progress Telerik Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin , a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.