WPF Datagrid that allows for ranking?
I have a WPF application and use datagrids. I have a list of name and I want users to be able to rank them in order of priority. So each name would have an u开发者_运维问答p/down arrow next to it and clicking on them would move the name up or down the list accordingly. I'm wondering if there is an existing control or example of how to do this.
You don't need a specific control to do that...
You can use a DataGridTemplateColumn
and include arrow buttons in the template. These buttons would be mapped to commands to increase or decrease the priority. If the items are ordered by priority (using ICollectionView.SortDescriptions
or CollectionViewSource.SortDescriptions
), they will automatically be reordered in the DataGrid
.
精彩评论