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

Navigating a grid grouping control

Hi,

Is there an example that shows how to navigating programatically to a specific row in a grid grouping control, expanding to the rows level?

Thanks

WJL

6 Replies

AD Administrator Syncfusion Team March 9, 2007 03:17 PM UTC

Hi Bill,

Here is a code snippet that shows you 'How to navigate a specific row and expand it in a grid ?"

Element el = this.grid.TableControl.Table.DisplayElements[ RowIndex ];
if( el.Kind == DisplayElementKind.Record)
{
GridRecordRow rec = el as GridRecordRow;
if( rec.ParentRecord != null)
{
if( rec.ParentRecord.NestedTables.Count > 0 )
rec.ParentRecord.IsExpanded = true;
rec.ParentRecord.SetCurrent("ColumnName");
}
}

Best regards,
Haneef


BL Bill Langlais March 11, 2007 05:00 AM UTC

I tried the code you sent but it is not working as expeced. Here is my code (in C++).

GridTable *gt = MainForm->GridSkiResults->GetTableControl(SegmentDataTable)->Table;
Element *el = gt->DisplayElements->Item[RowIndex];

if(el->Kind == DisplayElementKind::Record) {
GridRecordRow *rec = dynamic_cast(el);
if(rec->ParentRecord != NULL) {
if(rec->ParentRecord->NestedTables->Count > 0) {
rec->ParentRecord->IsExpanded = true;
rec->ParentRecord->SetCurrent(TimeColumn);
}
}
}

When this code executes:
el->Kind = Record
rec = NULL
el->TableLevel = 0
el->ParentRecord = NULL

I am not sure why TableLevel = 0 since this table is 5 levels deep in the nesting.


BL Bill Langlais March 12, 2007 06:46 PM UTC

Here is the code I use to locate the grid record


long
RawTrackData::GetGridRecord(long PointIndex)
{
int idx;
Record *Rec;

if(PointIndex != -1) {
UnsortedRecordsCollection *Records = dynamic_cast(MainFormObject)->GridSkiResults->GetTable(SegmentDataTable)->UnsortedRecords;

for(long RecIndex = 0 ; RecIndex < Records->Count ; ++RecIndex) {
Rec = Records->Item[RecIndex];
idx = Convert::ToInt32(Rec->GetValue(CoordinatesColumn));

if(Points[idx]->time.Ticks == Points[PointIndex]->time.Ticks) {
int x = Records->IndexOf(Rec);
return(RecIndex);
}
}
}

return(-1);
}


AD Administrator Syncfusion Team March 12, 2007 07:15 PM UTC

Hi Bill,

We need more information to analyze your problem. What version of the grid and .Net framework are you using? Also what are the events you are handling?

We were not able to reproduce the issue in Essential version 4.4 with .Net 1.1 &2.0 . Is it possible for you to upload us a sample or modify the browser sample to reproduce the issue here? This will help us to analyse the issue further.

Best Regards,
Haneef


BL Bill Langlais March 12, 2007 07:45 PM UTC

Hi,

The only way I can think of is to upload the application which is quite large. Is there a private location (that other users cannot get to) that I can upload it to?


BL Bill Langlais March 12, 2007 07:47 PM UTC

I am using Syncfusion Essential Grid version

4.2.0.37

In Visual Studio 2003 with .net 1.1

Loader.
Live Chat Icon For mobile
Up arrow icon