You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privatevoiddg_Sorting(objectsender,DataGridColumnEventArgse){//Use the Tag property to pass the bound column name for the sorting implementation if(e.Column.Tag.ToString()=="Range"){//Use the Tag property to pass the bound column name for the sorting implementationif(e.Column.Tag.ToString()=="Range"){//Implement sort on the column "Range" using LINQif(e.Column.SortDirection==null||e.Column.SortDirection==DataGridSortDirection.Descending){dg.ItemsSource=newObservableCollection<Mountain>(fromitemin_items
orderby item.Range ascending
selectitem);e.Column.SortDirection=DataGridSortDirection.Ascending;}else{dg.ItemsSource=newObservableCollection<Mountain>(fromitemin_items
orderby item.Range descending
selectitem);e.Column.SortDirection=DataGridSortDirection.Descending;}}// add code to handle sorting by other columns as required// Remove sorting indicators from other columnsforeach(vardgColumnindg.Columns){if(dgColumn.Tag.ToString()!=e.Column.Tag.ToString()){dgColumn.SortDirection=null;}}}}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 30d57dec-db78-95f6-cb6e-2d9a57cda112
Version Independent ID: c4e5087a-0927-05ff-aec1-ff89aa378279
This is redundant, right?
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Tasks
The text was updated successfully, but these errors were encountered: