How to get current record when there are nested tables?

Hi All,

I got a GCC with nested tables. Does anybody know how to get the record pointed by triangle cursor in the record header?

I tried to use selections but it is possible to select records from multiple tables and I need only the one record pointed by the cursor.

Thanks you for the help,
Alexey




1 Reply

JJ Jisha Joy Syncfusion Team March 6, 2009 05:36 AM UTC

Hi Alexey,

The information about the current record is retrieved by capturing the element that is shown at the current mouse position.

Here is a sample code snippet.

Point pt = this.gridGroupingControl1.TableControl.PointToClient(Control.MousePosition);

if (this.gridGroupingControl1.TableControl.ClientRectangle.Contains(pt))
{
Element el = this.gridGroupingControl1.TableControl.PointToNestedDisplayElement(pt);
if (el != null)
{
Record r = el.GetRecord();
if (r != null)
this.lblElement.Text = r.ToString();
else
this.lblElement.Text = el.ToString();
}
}

Please see the following sample from our sample browser.
..\My Documents\Syncfusion\EssentialStudio\7.1.0.30\Windows\Grid.Grouping.Windows\Samples\2.0\Grouping Architecture\Access Current Element-Cell Demo\cs

Let me know if you have any questions.

Regards,
Jisha



Loader.
Up arrow icon