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
close icon

Autoselect first row in GridGroupingControl

Hi

I have a GridGroupingControl and I want to auto select the first row of the data in the grid.

I have tried some similar examples from other posts in the fórum but I do not get the first row selected

I have used this code:

Record rec = clientGridControl.Table.Records[0];

int rowIndex = clientGridControl.Table.DisplayElements.IndexOf(rec);

clientGridControl.TableControl.CurrentCell.MoveTo(rowIndex, 1, GridSetCurrentCellOptions.ScrollInView);

But I do not see the first row highlighted.

Hope you can help me


1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team September 28, 2014 06:23 PM UTC

Hi Gustavo,

 

Thank you for your interest in Syncfusion products.

 

If you want to highlight the particular row of the data in GridGroupingControl, you can use the “Selection” property. Please refer the below code,

 

Code Snippet:

            Record rec = this.gridGroupingControl1.Table.Records[0];           

            this.gridGroupingControl1.TableModel.Selections.Add(GridRangeInfo.Row(rec.GetRowIndex()));          

            int rowIndex = gridGroupingControl1.Table.DisplayElements.IndexOf(rec);

            this.gridGroupingControl1.TableControl.CurrentCell.MoveTo(rowIndex, 1, GridSetCurrentCellOptions.ScrollInView); 

 

Please let us if you have any concern.

 

Regards,

Muthukumar K


Loader.
Live Chat Icon For mobile
Up arrow icon