Enable to Focus (Scroll) on the selectedRecord !!!

SelectedRecordsCollection selectedRecords = grid.Table.SelectedRecords; // Keep selected records

records = new List(); // After refresh Data grid
if (selectedRecords.Count > 0)
{
foreach (SelectedRecord selectedRecord in selectedRecords)
{
Record r = new Record(grid.Table);
r = selectedRecord.Record;
records.Add(r);
}
}


foreach (Record record in records)
{
grid.Table.SelectedRecords.Add(record);
record.SetCurrent();
}


// PROBLEM

The selected records has no Focus on it...
When debugging, I Found that indexOf(record) return 0 ??

It seems to happen only when new records are added in the grid.

Please help me to Understand this.



1 Reply

HA haneefm Syncfusion Team November 23, 2007 11:48 PM UTC

Hi Franck,

You need to call the CurrentRecord.SetCurrent( arg) method after adding the SelectedRecords in a GridTable. Please try these code and let me know if this helps.

this.gridGroupingControl1.Table.CurrentRecord.SetCurrent("ColumnName");
this.gridGroupingControl1.Table.CurrentRecordManager.ForceShowCurrentRecord = true;

Best regards,
Haneef.


Loader.
Up arrow icon