Record.SetCurrent() bug within a Self-related GGC

Hi,
I have attached an amended Self-related grid example app that you sent to me in response to a different question: (http://www.syncfusion.com/support/forums/message.aspx?&MessageID=67687). I have attempted to implement a simple "search and highlight" functionality in the code whereby the code finds a given value in a given column and sets the focus to the matching row. I can easily find the row but when I attempt to set the focus to the row (using Record.SetCurrent) it does not happen. If I do this without self-relation implemented (no hierarchy) then it works fine. Is this a bug or can you provide a workaround? To see this click the "Find and Highlight" button in the attached example.

SelfRelations.zip

2 Replies

GR Golda Rebecal Syncfusion Team September 17, 2007 01:57 PM UTC

Hi Paul,

Sorry for the delay in responding.

I am able to see that Record.SetCurrent is not working as expected when self-relation is used in GridGroupingControl.

Currently I am analyzing this issue to find a workaround and will get back to you within 1 business day.

Thank you for your patience.

Best regards,
Golda


GR Golda Rebecal Syncfusion Team September 25, 2007 06:46 AM UTC

Hi Paul,

Sorry for the delay in responding.

In order to set a record in a nested table as current, you have to expand its parent record and then set this record as current.

Here is the code snippet:


Record parent = null;
Record rec = null;
private void button5_Click(object sender, EventArgs e)
{
foreach(Record r in gridGroupingControl2.Table.Records)
{
foreach (Record rc in r.NestedTables[0].ChildTable.Records)
{
if (rc.GetValue(column).ToString() == "CRD DS ERICSSON EUR")
{
parent = r;
rec = rc;
break;
}
}
}
parent.IsExpanded = true;
rec.SetCurrent();
}


Please refer to the modified sample that illustrates the same:
http://websamples.syncfusion.com/samples/Grid.Windows/F68172/main.htm

Kindly let me know if this helps you.

We appreciate your interest in Syncfusion products.

Best regards,
Golda

Loader.
Up arrow icon