Find the first visible record

Hi,

How do I find a first visible record on the screen in GGC. Grid may contain more than one table. It may also has any relations. Any number of groups collapsed and expanded. Any filters. There are may be or not table headers, column headers, etc...

Regards,
Alexander.

1 Reply

HA haneefm Syncfusion Team May 10, 2007 10:25 PM UTC

Hi Alexander,

You can try this code.

private void button1_Click(object sender, System.EventArgs e)
{
int iFirstVisibleRow = this.gridGroupingControl1.TableControl.TopRowIndex ;
Element el = this.gridGroupingControl1.Engine.CreateEmptySection( this.gridGroupingControl1.Table.TopLevelGroup );
do
{
int iTotalElements = this.gridGroupingControl1.Table.NestedDisplayElements.Count;
if( iFirstVisibleRow < iTotalElements )
el = this.gridGroupingControl1.Table.NestedDisplayElements[ iFirstVisibleRow ];
else
break;
iFirstVisibleRow++;
}
while( el.Kind != DisplayElementKind.Record ) ;

Console.WriteLine("First Visible Record is ==>" + el.GetRecord());
}

Best regards,
Haneef

Loader.
Up arrow icon