Click here to Skip to main content
15,886,535 members
Articles / Desktop Programming / WPF

WPF DataGrid: Solving Sorting, ScrollIntoView, Refresh and Focus Problems

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
5 Feb 2021CPOL5 min read 17.8K   12  
Letting the user move some rows up and down in a DataGrid should be easy to implement, but it's a nightmare.
Surprisingly, many challenges were encountered when changing some WPF DataGrid data from code behind which required a new sorting of the rows and scrolling the DataGrid to show the initially selected rows. The article focuses on describing the problems encountered and how to solve it. At the end is the complete sample code.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Singapore Singapore
Retired SW Developer from Switzerland living in Singapore

Interested in WPF projects.

Comments and Discussions