开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜