How to Pass Cell Information from DataGrid in WPF KeyBinding?

后端 未结 2 555
半阙折子戏
半阙折子戏 2021-01-17 04:04

I\'m having a DataGrid to list the MobileInfo Collection. The DataGrid is Configured with SelectionUnit=\"FullRow\". If I Click the any Row then it selects the

2条回答
  •  长发绾君心
    2021-01-17 04:55

    you can simply use CurrentCellChanged Event in DataGrid xaml.

     CurrentCellChanged="DataGrid_CurrentCellChanged"
    

    code...

    private void DataGrid_CurrentCellChanged(object sender, EventArgs e)
            {
                var grid = sender as DataGrid;
                var cell = grid.CurrentCell.Item;
            }
    

提交回复
热议问题