【发布时间】:2011-01-30 14:35:59
【问题描述】:
如何禁用 WPFTooklit 的 DataGrid 中的选择?
我尝试修改适用于ListView(来自WPF ListView turn off selection)的解决方案,但这不起作用:
<tk:DataGrid>
<tk:DataGrid.ItemContainerStyle>
<Style TargetType="{x:Type tk:DataGridRow}">
<Setter Property="Focusable" Value="false"/>
</Style>
</tk:DataGrid.ItemContainerStyle>
<tk:DataGrid.CellStyle>
<Style TargetType="{x:Type tk:DataGridCell}">
<Setter Property="Focusable" Value="false"/>
</Style>
</tk:DataGrid.CellStyle>
</tk:DataGrid>
【问题讨论】:
标签: c# wpf datagrid focus selection