We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to to select a given DataRow in a GGC?

Hi,
I have a GGC with several nested DataTables, Im adding a row to one of the child tables and I want it to be selected in the GGC, expanding any parent nodes on the way. I also want the GGC to scroll if required to ensure the row is visible.

Do you have any examples on how to do this?

Thanks
John

1 Reply

HA haneefm Syncfusion Team October 4, 2007 08:31 PM UTC

Hi John,

You can use the UnsortedRecords property to find the newly record and set that record as current record using the SetCurrent method. Below are the codes that shows this task.

GridTable _table = this.gridGroupingControl1.GetTable("TableName");
int Oldcount = _table.UnsortedRecords.Count;

DataTable dt = ds.Tables["TableName"];
DataRow dr = dt.NewRow();
dr["Col1"] = "NewValue";
dt.Rows.Add(dr);
dt.AcceptChanges();

_table.UnsortedRecords[Oldcount].SetCurrent("ColumnName");
_table.UnsortedRecords[Oldcount].SetSelected(true);

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon