Wpf工具包datagrid DataGridCheckBoxColumn on_click事件:
我想获取选定的行,但 selecteditems 只有一行。我想要获得所有已检查的项目。我想我需要在选中复选框时添加事件处理程序,然后收集它们。我该如何以最好的方式做到这一点?
I want to get the selected rows, but selecteditems has only one row. I want get the all the checked item. I think I need to add event handler when the checkbox is clecked and then collect them all. How do I do this in a best way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否使用数据绑定来填充 DataGrid?如果是这样,将列的检查值绑定到支持对象中的 bool 可能是执行此操作的“最佳”(如:最佳实践)方法。这是一些示例代码:
Are you using databinding to populate your DataGrid? If so, binding the checked value of your column to a bool in your backing object is probably the "best" (as in: best-practices) way to do this. Here is some example code: