c# – WPF Datagrid获取所选单元格值

c# – WPF Datagrid获取所选单元格值,第1张

概述我想要获取datagrid中所选单元格的值,请任何人告诉如何做到这一点.我使用了SelectedCell改变的事件,我该怎么办? dataGrid1.CurrentCell 请参考MSDN上的 DataGrid Class页.从那个页面: Selection By default, the entire row is selected when a user clicks a cell in a 我想要获取datagrID中所选单元格的值,请任何人告诉如何做到这一点.我使用了SelectedCell改变的事件,我该怎么办?
dataGrID1.CurrentCell
解决方法 请参考MSDN上的 DataGrid Class页.从那个页面:

Selection

By default,the entire row is selected when a user clicks a cell in a DataGrID,and a user can select multiple rows. You can set the 07001 property to specify whether a user can select cells,full rows,or both. Set the SelectionUnit property to specify whether multiple rows or cells can be selected,or only single rows or cells.

You can get information about the cells that are selected from the 07002 property. You can get information about cells for which selection has changed in the 07003 of the SelectedCellsChanged event. Call the SelectAllCells or UnselectAllCells methods to programmatically select or unselect all cells. For more information,see Default Keyboard and Mouse Behavior in the DataGrID Control.

我已经为您添加了相关属性的链接,但我现在已经不在时间了,所以希望您可以按照链接获取您的解决方案.

总结

以上是内存溢出为你收集整理的c# – WPF Datagrid获取所选单元格值全部内容,希望文章能够帮你解决c# – WPF Datagrid获取所选单元格值所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1260555.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-08
下一篇2022-06-08

发表评论

登录后才能评论

评论列表(0条)

    保存