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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridQueryCellInfo, col and row indexes

Thread ID:





35839 Oct 11,2005 08:56 PM UTC Oct 11,2005 09:59 PM UTC WinForms 2
Tags: GridControl
Asked On October 11, 2005 08:56 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

Replied On October 11, 2005 09:59 PM UTC

Ok, thanks.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon