<syncfusion:SfDataGrid Name="sfDataGrid"
AutoGenerateColumns="False"
LiveDataUpdateMode="AllowDataShaping"
ItemsSource="{Binding Orders}"> |
private async void SfDataGrid_SortColumnsChanged(object sender, Syncfusion.UI.Xaml.Grid.GridSortColumnsChangedEventArgs e)
{
var dispatcher = Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().CoreWindow.Dispatcher;
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
foreach (var item in this.sfDataGrid.View.Records)
{
var employeeId = ((item as RecordEntry).Data as Employee).EmployeeID;
//Print the sorted record in output window.
System.Diagnostics.Debug.WriteLine(employeeId.ToString());
}
System.Diagnostics.Debug.WriteLine("Sorting done");
});
} |