Hi,
In my page, it consists of a ListBox and a GridView, when Selection of ListBox is Changed, the Columns of GridView also be changed. Different listboxitem have different columns of GridView. I use this way to set the value to binding the different data Source to display:
target.DataMemberBinding = source.DataMemberBinding;
target.Header = source.Header;
target.DataFormatString = source.DataFormatString;
target.TextAlignment = source.TextAlignment;
if (target.DataMemberBinding != null && source.DataMemberBinding != null)
target.DataMemberBinding.Converter = source.DataMemberBinding.Converter;
target.IsReadOnly = source.IsReadOnly;
target.ItemsSource = differentSource;
now, it has a problem, when changing the selection of ListBox, it is so slow to load the new columns. In other words, the page responses slowly. there are two attachfile. please check it.
In my page, it consists of a ListBox and a GridView, when Selection of ListBox is Changed, the Columns of GridView also be changed. Different listboxitem have different columns of GridView. I use this way to set the value to binding the different data Source to display:
target.DataMemberBinding = source.DataMemberBinding;
target.Header = source.Header;
target.DataFormatString = source.DataFormatString;
target.TextAlignment = source.TextAlignment;
if (target.DataMemberBinding != null && source.DataMemberBinding != null)
target.DataMemberBinding.Converter = source.DataMemberBinding.Converter;
target.IsReadOnly = source.IsReadOnly;
target.ItemsSource = differentSource;
now, it has a problem, when changing the selection of ListBox, it is so slow to load the new columns. In other words, the page responses slowly. there are two attachfile. please check it.