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

我想要获取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.

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

相关文章

在要实现单例模式的类当中添加如下代码:实例化的时候:frmC...
1、如果制作圆角窗体,窗体先继承DOTNETBAR的:public parti...
根据网上资料,自己很粗略的实现了一个winform搜索提示,但是...
近期在做DSOFramer这个控件,打算自己弄一个自定义控件来封装...
今天玩了一把WMI,查询了一下电脑的硬件信息,感觉很多代码都...
最近在研究WinWordControl这个控件,因为上级要求在系统里,...