GridQueryCellInfo, col and row indexes

In my GridQueryCellInfo I have to subtract one from ColIndex and RowIndex when indexing into my data source, as row 0 will be column headers and of course col 0 is row headers. So col 1 of the grid, which is the first data column, is going to be 0 or ColIndex - 1 in my datasource, and so on. I need to make the col headers expand to 2 or 3 rows, possibly depending on user preference. So now the offset I have to adjust these variables to index into my data source will change. Is there any trick to mapping e.RowIndex and e.ColIndex somehow so that when I''m asked for row/col of data, they are 0-based? Of course, I still need to be able to be queried for the column header(s) text, though even if e.RowIndex was -1 that would be ok. This may seem like a strange request, but I''m just looking for some way to keep my code in GridQueryCellInfo looking pretty clean. I''m rewriting some old Stingray grid code where I actually had 8 or 9 rows of header information before data started, and this could go in that direction eventually. If no such trick exists, I can live with it. Jim

2 Replies

AD Administrator Syncfusion Team October 11, 2005 09:42 PM UTC

grid.Rows.HeaderCount gives the index of the last header row. So, the default one-header grid has this property set to zero. If you have 1 extra header (for a total of two header rows), grid.Rows.HeaderCount is 1.


JI Jim October 11, 2005 09:59 PM UTC

Ok, thanks.

Loader.
Up arrow icon