Hello,
I'm having some trouble to get the event (PropertyChanged) fired in Telerik.Data.Core.PropertySortDescriptor().
I'm using the sample from https://github.com/telerik/UI-For-UWP/tree/master/SDKExamples.UWP
ColumReordering.xaml
change grid ...
<grid:RadDataGrid x:Name="grid" Loaded="Grid_Loaded" UserGroupMode="Disabled" UserFilterMode="Disabled" UserSortMode="Single" Grid.Row="2" AutoGenerateColumns="False"/>
ColumReordering.xaml.cs
Remove from Constructor (DataContext)
public ColumnReordering()
{
this.InitializeComponent();
this.combo.ItemsSource = Enum.GetValues(typeof(DataGridUserColumnReorderMode));
this.combo.SelectedItem = DataGridUserColumnReorderMode.Interactive;
}
private void Grid_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
var lstToBind = new List<Student>(Enumerable.Range(9, 10).Select(i => new Student { Name = "Name" + i.ToString(), Age = 9 + i }));
var lstColumns = new List<string>() { "Name", "Age" };
this.grid.SortDescriptors.Clear();
foreach (var obj in lstColumns)
{
var col = new Telerik.UI.Xaml.Controls.Grid.DataGridTextColumn();
col.CanUserSort = true;
var st = new Telerik.Data.Core.PropertySortDescriptor();
st.PropertyName = obj;
st.SortOrder = Telerik.Data.Core.SortOrder.Descending;
st.PropertyChanged += St_PropertyChanged;
this.grid.SortDescriptors.Add(st);
col.PropertyName = obj;
col.Name = obj;
grid.Columns.Add(col);
}
this.grid.ItemsSource = lstToBind;
}
private void St_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
}
-----------------------------------------------------------------------------------------------------------
St_PropertyChanged has never fired...
Best Regards
João Guedes