Hi,
I have the requirement to sort one field in my xamdatagrid descending on the first click on the label.
At the moment it requires two clicks as the field is sorted ascending first.
How can i achieve this?
I'm using version 14.1 with mvvm.
Best
Oliver
Hello Oliver,
Thank you for your post!
I have been looking into it and what I can suggest is to take a look at the following forum thread where similar issue is discussed: http://es.infragistics.com/community/forums/t/86888.aspx.
On this thread you would be able to find a sample application too.
Please do not hesitate to let me know if you have any further questions on this matter.
Hi Gergana,
I tried to overwrite the OnSorting Event but it doesn't change anything. Can you fix it?
protected override void OnSorting(SortingEventArgs e) { string sortedInfo = e.Field.Name;
if (string.Equals(sortedInfo, "IsInvalid")) { if (e.SortDescription.Direction == ListSortDirection.Ascending) { ICollectionView iCollectionView = (ICollectionView)DataSource; iCollectionView.SortDescriptions.Clear(); iCollectionView.SortDescriptions.Add( new SortDescription(sortedInfo, ListSortDirection.Descending)); } else { ICollectionView iCollectionView = (ICollectionView) DataSource; iCollectionView.SortDescriptions.Clear(); iCollectionView.SortDescriptions.Add( new SortDescription(sortedInfo, ListSortDirection.Ascending)); } } else { base.OnSorting(e); } }