You may have tried to select a row in a DataGrid in WPF programmatically by setting its SelectedItem property or SelectedIndex property only to find out that doing this doesn’t result in the exact same behaviour as when you select a row by clicking on it with the mouse.
Data binding with Data Grid in WPF how it is bind bcz direct data table not binding Rows.Add(newRow), ) ) dataGrid_selectCompany.ItemsSource = data In WinForms, I am populating each node programmatically but I would like to take.
Are you using the WPF Toolkit DataGrid? – jsmith Dec 29 '09 at 18:27.
property then assign this item to you DataGrid.SelectedItem property programmatically, alternatively you can add it to your DataGrid.SelectedItems collection if you want to allow the user to select more than one row.