Looping through grid-rows in gridControl1

Hi, everyone

I'd like to know how to loop through gridrows in gridControl.
If anyone can do it, please give me simple example how to do it, and how to get the CellValue of the first column, in the current grid-row (inside the loop). I'm using vb.net.

Thanks, and have a good day :)
Allon

3 Replies

JJ Jisha Joy Syncfusion Team September 9, 2009 10:05 AM UTC

Hi Allon,

Thank you for posting query to us.

You could access the cell values of the GridControl by looping through the rows and columns. See the code:


For row As Integer = 1 To Me.GridControl1.RowCount
For col As Integer = 1 To Me.GridControl1.ColCount
Console.WriteLine(Me.GridControl1(row, col).CellValue.ToString())
Next col
Next row


Please let me know if this helps.

Regards,
Jisha


AL Allon September 9, 2009 10:33 AM UTC

Thanks a lot, Jisha. I know that kind of solution already. What I realy wanted to know is what is the object, which act as DataGridRow in Syncfusion's gridControl.

Regards,
Allon


JJ Jisha Joy Syncfusion Team September 10, 2009 09:12 AM UTC

Hi Allon,

GridControl is not a bounded grid and it is a cell oriented grid. If you want to get the row data, then you need to loop through cells. But our GridGroupingControl is a bounded grid and you could access the records by using the following code:

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

Please let me know if you have nay questions.

Regards,
Jisha

Loader.
Up arrow icon