WPF DataGrid - Set a cell into edit mode programmatically

后端 未结 2 1757
感情败类
感情败类 2021-02-19 09:50
  • I have a WPF DataGrid that shows some data records (bounded to an ObservableCollection).

  • When the user clicks \"Edit\" button, the currend selected row

2条回答
  •  余生分开走
    2021-02-19 10:43

    Assuming WPF:

    
    

    Then this code will work:

    dg.CurrentCell = new DataGridCellInfo(dg.Items[i], dg.Columns[j]);
    dg.BeginEdit();
    

提交回复
热议问题