简体   繁体   中英

How do I select a single cell in a WPF datagrid?

When I click a cell in a WPF datagrid, the whole row is selected, and when I press Ctrl + C to copy the content, the whole row i copied...

How do I select and copy the content of a single cell?

使用Datagrid的SelectionUnit属性。

WPF datagrid comes up with the 'SelectionUnit' property.
You can set the following values 'SingleCell/FullRow/CellorRowHeader'.
If you want to select multiple rows, use the 'SelectionMode' property and set the value to 'Extended.'

这是WPF网格中的一个选项,您应该有一个名为SelectionMode的属性(或者类似于您正在使用的数据网格的属性),用于定义单元格的选择方式。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM