This project has moved and is read-only. For the latest updates, please go here.

datagrid sorting problem

Aug 20, 2014 at 4:23 PM
Edited Aug 20, 2014 at 4:33 PM
Is there a way to make a datagrid ALWAYS sort by the group selections first when those group selections are being made at runtime by the user.
I basically need to be able to sort by any column but I don't want my groups jumping all over the screen each time i implement a sort. I want sorting to be done within groups.
Any ideas?

It would also be useful to me if when you perform a sort change groups stay in the state they are in (expanded or not) and do not have to all expand or close.
Aug 21, 2014 at 3:27 PM

In the DataGrid, sorting is done in the grid and can't be done only within groups.

The reason why the grid could be jumping all over the screen may be because the current item wants to stay on screen. So when the sorting changes, the current item has a new position and this position is now into view. You could try to set DataGridControl.AutoScrollCurrentItem from AutoScrollCurrentItemTriggers.All to AutoScrollCurrentItemTriggers.None. This, way, the current item would not stay in view, and no scrolling would happen.

If I Collapse some groups and click on a column to do a sort, the collapsed groups remains collapsed and the expanded groups remains expanded.
Sep 4, 2014 at 3:17 PM
Edited Sep 4, 2014 at 4:08 PM
I am still having the problem where if i collapse some groups and do a sort all groups are expanded following the sort - any ideas on why this might be happening?

Is it possible to get some example code of a tableflowview datagrid "in action"? The demo I looked at on the xceed site behaves exactly how I want my datagrid to - but I can't seem to get my datagrid to work the same.
Sep 5, 2014 at 8:35 PM

What version of the Toolkit are you using ? Can you provide a sample of the problem ?
Sep 9, 2014 at 9:13 AM
I have just managed to solve my problem :) Since I did not need any default sorting in the xaml code I had left out the collection view source and bound directly to itemssource. With a "dummy" collection view source in place in the xaml everything works as expected. Thanks for your help trying to track down the problem.