private void Devices_InitDataGrid() { foreach (DataGridColumn column in dgDevices.Columns) { column.SortDirection = null; column.Width = new DataGridLength(0, DataGridLengthUnitType.Pixel); column.Width = new DataGridLength(0, DataGridLengthUnitType.Auto); } DeviceComparer.SetComparer(Devices_collectionView as ListCollectionView, dgcDeviceName); }
// Event: Devices_DataGrid_Sorting private void Devices_DataGrid_Sorting_Handler(object sender, DataGridSortingEventArgs evt) { evt.Handled = DeviceComparer.SetComparer(Devices_collectionView as ListCollectionView, evt.Column); Devices_SelectNone(); }