AD
Administrator
Syncfusion Team
November 17, 2003 01:46 PM UTC
I would suggest using CurrentCell.MoveTo instead CurrentCell.Activate, but this change would not really affect your question on HeaderCount.
HeaderCount = 0 is the default setting when there is 1 row header (or one column header). When you set Cols.HeaderCount = 1, then you see 2 header rows. So, the HeaderCount is really the grid position of last header, starting from zero. Now, the HeaderCount will always be at least zero as the headers are always counted as present even if they are hidden. This is consistent with hidden rows not affecting RowCount as the rows are present, but just hidden.
So, I think your code using HeaderCount+1 should always pick out the proper first-nonheader-cell. Do you have a situation where this code does not pick out the proper cell?
JB
Jeff Block
November 17, 2003 02:04 PM UTC
No...it just seemed that "count" would return the number of header rows, not the index of the last header row, but given your explanation I'll take it for what its worth and just add one to the counts.
In doing some more testing, if I turn off the headers all together with Grid.Properties.ColHeaders = false and Grid.Properties.RowHeaders = false, I still get 0 for both counts. But, CurrentCell.Activate( 1, 1) still activates the correct row (the first one). Seems odd, but...
Jeff