User (Old forums)MemberMay 30, 2011 at 10:08 amPost count: 23064
When you select a row and then
change the sort, the grid will automatically scroll and select the same
row after the sorting is complete. However, I have a case where I need
to turn that off. So Is there any way to do that without using custom control and code behind.? Because I’m using MVVM designing pattern for my application.
Imported from legacy forums. Posted by Rahul (had 434 views)Xceed SupportMemberMay 30, 2011 at 12:28 pmPost count: 5658
When the sort order is changed, it does automatically select the row you had selected. There is a workaround for this. You can refer to the following forum thread where you need to subscribe to the ItemsSourceChangeCompleted event and through there you can use a Dispatcher call to decide which DataRow you want selected.
Imported from legacy forums. Posted by Marc [Xceed] (had 182 views)User (Old forums)MemberMay 31, 2011 at 6:37 amPost count: 23064
Thanks for your quick response. But actually I dont want to do this in code behind. Because in our application we are following MVVM pattern and also we have used the grid in around 20-30 places. Also using custom grid we can solve this problem. I know this two solution but is there any other way to do this?
Imported from legacy forums. Posted by Rahul (had 196 views)Xceed SupportMemberMay 31, 2011 at 5:07 pmPost count: 5658
The best way to do this is by using your own derived DataGrid for the sorting behavior your require and using it with MVVM. In the derived DataGrid, you can change the behavior to best fit your requirements
Imported from legacy forums. Posted by Marc [Xceed] (had 780 views)chaperonaKeymasterDecember 20, 2016 at 6:22 pmPost count: 3
The AutoScrollCurrentItem property on DataGridControl resolves this issue.
- You must be logged in to reply to this topic.