How programmatically select a row in grid

How do I programmatically select a row in Syncfusion.Windows.Forms.Grid.GridDataBoundGrid?


1 Reply

MA Madhankumar Syncfusion Team July 31, 2007 09:17 PM UTC

Hi Mineev

Thank you for your patience.

This can be achieved by setting the ListBoxSelectionMode to One and adding the required row to be selected to the grid selections. The following is the code snippet.

++++++++ Code Snippet ++++++++
this.gridDataBoundGrid1.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One;

////To select the row programattically, Use the below code
gridDataBoundGrid1.Model.Selections.Add(Syncfusion.Windows.Forms.Grid.GridRangeInfo.Row(2));
++++++++ Code Snippet ++++++++

Kindly let us know if you need any further help.
Have a nice day.

Best regards,
Madhan

Loader.
Up arrow icon