Hi Chris,
Thank you for contacting Syncfusion Support.
You can set the selected item as new row by using SelectedIndex or SelectedItem property in SfDataGrid. Please refer the below code snippet,
|
private void Form1_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.Action != System.Collections.Specialized.NotifyCollectionChangedAction.Add) return;
var recordIndex = e.NewStartingIndex;
if (recordIndex == -1) return;
//Apply selection by setting SelectedIndex as newly added Index
//this.sfDataGrid.SelectedIndex = recordIndex;
//or Apply selection by using SelectedItem
var rowIndex = sfDataGrid.TableControl.ResolveToRowIndex(recordIndex);
//get the record by passing index in GetRecordAtRowIndex SelectionHelper method
var record = SelectionHelper.GetRecordAtRowIndex(this.sfDataGrid, rowIndex);
//set the selected item as record
this.sfDataGrid.SelectedItem = record;
} |
Please let us know if you have any concerns in this.
Regards,
Vijayarasan S