Hi,
I tried the exemple that you give me and I can now select the row that I want
The problem is after I select the row that I want when I try to get the new rowIndex of this new row I still get the old rowIndex
This an exemple of a test that I do to verify if the rowIndexof the new row selected has changed
Dim iRowIndex As Int32 = gcTermes.CurrentCell.RowIndex()
' I show the actual row Index of the actual selected row
MsgBox(iRowIndex.ToString)
gcTermes.Model.Rows.RemoveRange(iRowIndex, iRowIndex)
' I select the rows just before the actual row selecteted
gcTermes.Model.Selections.Add(GridRangeInfo.Rows((iRowIndex - 1), (iRowIndex - 1)))
' I show the actual Selected rowIndex
msgBox(gcTermes.CurrentCell.RowIndex.toString)
What i am looking for is to select a specific row in the grid just like when you click on the row with a mouse click
Do you know what I am doing wrong?
Thanks in advance an have a nice day
>
Hi,
You can select a specific row at a specific rowindex with the help of following code snippet.
private void button1_Click(object sender, EventArgs e)
{
this.gridControl1.Model.Selections.Add(GridRangeInfo.Rows(2,3));
}
private void Form1_Load(object sender, EventArgs e)
{
this.gridControl1.AllowSelection = GridSelectionFlags.Any;
this.gridControl1.ListBoxSelectionMode = SelectionMode.MultiExtended;
this.gridControl1.AlphaBlendSelectionColor = Color.Yellow;
}
Please refer the sample in the below link that illustrates the above.
http://websamples.syncfusion.com/samples/Grid.Windows/F73347/main.htmPlease let me know if you have any questions.
Regards,
Asem.