Recently i have encountered in some issue filtering columns in DataGrid. That can be achieved by following code :
The result of such code may look like following:
But there is some problem with this code :
- When clicking on any column, we don’t see any feedback it was clicked
- No filter applied when clicked on column anyway
We defined CanUserSort on each DataGrid column. We defined CanUserSortColumns in whole DataGrid as well. But there we miss something small but important detail: Since we defined DataGridTemplate and we didn’t define how we would like to sort, WPF doesn’t know the way to sort for us our items.