【问题标题】:WPF XAML : How to disable multi selection in a DataGrid?WPF XAML:如何在 DataGrid 中禁用多选?
【发布时间】:2011-06-20 21:57:24
【问题描述】:

在这样的 DataGrid 中:

<DataGrid  AutoGenerateColumns="False" Height="200" Name="dataGrid"
    IsReadOnly="True" ItemsSource="{Binding CollectionView}" >
...
</Datagrid>

如何禁用多选功能?

(我确定它很简单,但我没有找到它。)

【问题讨论】:

  • 想问一下如何在xaml中启用。

标签: wpf xaml datagrid multi-select


【解决方案1】:

设置 DataGrid.MultiSelect

this.DataGrid.MultiSelect = "false"

【讨论】:

  • 我在 xaml 中的 DataGrid 上找不到 MultiSelect。
【解决方案2】:

设置DataGrid.SelectionMode:

<DataGrid SelectionMode="Single" ...

【讨论】:

  • 哈哈,非常感谢 M.Copsey!
猜你喜欢
  • 2011-01-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多