【问题标题】:Xamdatagrid howto get the current Cell on right clickXamdatagrid 如何在右键单击时获取当前单元格
【发布时间】:2011-09-25 14:05:18
【问题描述】:

这是我想在一些 XamDataGrid 上实现的场景

  1. 可能会在网格中选择某些单元格 - 单元格而不是记录

  2. 用户右键单击网格中的单元格

如果之前未选中,我想将右键单击的单元格添加到 XamDataGrid 的 SelectedItems.Cells 集合中

顺便说一句 - 我得到整个记录没有问题,但我需要的是特定的单元格。

有什么想法吗?

【问题讨论】:

    标签: cell xamdatagrid right-click


    【解决方案1】:
    private void GridCellActivated(object sender, CellActivatedEventArgs e)
    {
        if (((UnboundField)((e.Cell).Field)).BindingPath.Path != null)
        {
          var _fieldPath = ((UnboundField) ((e.Cell).Field)).BindingPath.Path;   
        }
    }
    

    【讨论】:

    • 潜在读者注意:这仅适用于第一次点击。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-23
    • 2012-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多