WPF DataGrid 获取当前选中项


1 (DataRowView)DataGrid_Result.CurrentCell.Item)[DataGrid_Result.CurrentCell.Column.DisplayIndex].ToString()
测试时 SelectionMode 为 Cell。
CurrentCell 和 SelectedItem , SelectedCell 不是一回事,CurrentCell 才是当前选中的单元格,而且还只能获取对应列,(DataRowView)DataGrid_Result.CurrentCell.Item) 类似于选中的行。

WPF 的 DataGrid 很难玩啊……


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM