开发者

Xamdatagrid howto get the current Cell on right click

开发者 https://www.devze.com 2023-04-08 01:48 出处:网络
here is the scenario I want ta achieve on some XamDataGrid Some Cells may be selected in the grid - cellsand not records

here is the scenario I want ta achieve on some XamDataGrid

  1. Some Cells may be selected in the grid - cells and not records

  2. User right clicks on a cell in the grid

I would like to add the right clicked cell to the SelectedItems.Cells collection of the XamDataGrid if it wa开发者_运维问答s not selected before

BTW - I have no problem getting the entire Record, but what I require is the specific Cell.

any idea?


private void GridCellActivated(object sender, CellActivatedEventArgs e)
{
    if (((UnboundField)((e.Cell).Field)).BindingPath.Path != null)
    {
      var _fieldPath = ((UnboundField) ((e.Cell).Field)).BindingPath.Path;   
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号