Hi,
Please see the attached example, if you click on the "Apply Layout" first and then click on "Add items" button then you'd see the column sorting breaks, but if you comment Sort function in CollectionOnCollectionChanged function on line 25 then sorting does not break, the first column is sorted correctly, can you please explain this behavior?
That solves my problem. Thank you.
Hello Karthik,
It appears when binding to a CollectionView the grid is ignoring the initial setting for the IsSorted property if set in the XAML. Since the grid uses the SortDescriptions of the CollectionView you can achieve the initial sort by adding the SortDesription to the CollectionView and this will be carried over to the grid. I tested this using build 13.2.20132.2036 and when initially sorting the data via the collection view any additional rows added to the collection / grid were also sorted.
As far as the grid ignoring the IsSorted property when set in the XAML, I have asked our engineering team to look into this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 162646. The next step will be for a developer to review my investigation and confirm my findings or to offer a fix, or other resolution.
I have created a private case, CAS-130634-B3N7T2, for you to track this issue and notify you of any changes in the status of this issue. You may access this case at https://es.infragistics.com/my-account/support-activity.
Please let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
I set IsSorted="Descending" on the TextColumn of an Integer field in Xaml, and bind a collectionviewsource object to the grid. The data is dynamic, after the initial list that loads on constructor of viewmodel, the rest of the data is filled in as they arrive from server. Although the initial data seems to be sorted correctly, the data that comes in later on don't get sorted properly.
I don't have much time to investigate any further. Would be great if you can do and check what is happening here. Here is one way I got it to work: I added a flag on the xaml code behind and reset the IsSorted in the InitializeRow event of the XamGrid if the flag is not set and then set it again so the IsSorted is not set again and again.
The original issue on this thread turned out to be an issue with the binding in the sample as opposed to the controls.
You mention you are having an issue when you set IsSorted in your grid are you using the XamGrid as opposed to the XamDataGrid?
Hi I am facing the same problem. where I use a collection source and set the IsSorted from Xaml, but the sorting is not maintained after the collection gets new rows.
I am using version: 13.2.20132.1000. Can you tell me if it is fixed in this version?
Thank you,
Karthik.