【问题标题】:Cell content click WPF datagrid VB.net单元格内容单击 WPF datagrid VB.net
【发布时间】:2015-10-28 11:33:50
【问题描述】:

在 WPF 数据网格中是否有单击单元格内容之类的事件?我想在特定列单元格内容单击或单元格输入时打开自定义对话框?

【问题讨论】:

    标签: wpf


    【解决方案1】:

    您可以通过 DataGridCell 的 Style 中的 EventSetter 来完成。 例如:

    <DataGrid>
        <DataGrid.Resources>
            <Style TargetType="{x:Type DataGridCell}">
                <EventSetter Event="MouseLeftButtonUp" Handler="MyEventHandler" />
            </Style>
        </DataGrid.Resources>
    </DataGrid>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-29
      • 1970-01-01
      • 2023-01-13
      • 2010-11-20
      • 2018-06-05
      • 2012-11-22
      • 1970-01-01
      • 2015-05-05
      相关资源
      最近更新 更多