I have a grid with multiple columns and users can sort based on any column. Data, which is bound the grid is a collection of custom entity. I have a print button on the screen and on click of this button I need to do a custom print. Print must show the data in the same order as displayed in the grid (with additional data)
Is there any way to directly get the sorted datasource instead of sorting the datasource in the sorting event?
Thanks
Pankaj
Yes, there is. In WPF, always a
CollectionViewis bound, never the collection itself. If you don’t specify a collection view yourself, a default one is used. You can access this default collection view like this:This is the collection view as shown by the grid with all the sorting and filtering applied.