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.
Unfortunately, activation email could not send to your email. Please try again.

eliminating default headers and an indexing problem

Thread ID:

Created:

Updated:

Platform:

Replies:

21157 Nov 3,2004 10:21 AM Nov 3,2004 04:22 PM Windows Forms 3
loading
Tags: GridControl
Keith Steinbeck
Asked On November 3, 2004 10:21 AM

Hello, I''m evaluating Essential Suite for purchase and have run into an issue. I don''t EVER want to show the default row and column headers. I know I can hide them, but then the row/column indexing gets screwed up. For example, if I have default row and column headers, one additional row and column header, and 3 rows and 3 columns of data (a 5x5 grid), the cells are indexed 0-4,0-4 as expected. If I create that same grid, then hide row 0 and column 0 to eliminate the default headers, the cells are indexed 0,2,3,4 x 0,2,3,4. This does not seem correct to me. Where is row/column 1? I would expect 1-5, 1-5 or 0-3,0-3 as indexes, but why the skip? Is there a better way to eliminate the default headers and maintain proper zero-based indexing, or do I have to work out some special workaround? Thanks.

Keith Steinbeck
Replied On November 3, 2004 10:37 AM

>If I create that same grid, then hide row 0 and column 0 to eliminate the default headers, the cells are indexed 0,2,3,4 x 0,2,3,4. This does not seem correct to me. Where is row/column 1? I would expect 1-5, 1-5 or 0-3,0-3 as indexes, but why the skip? Oops, that should be 1-4, 1-4 or 0-3,0-3

Administrator [Syncfusion]
Replied On November 3, 2004 11:20 AM

In a GridControl, by default, row 1 is always the first scrollable row an dis immediately under row 0 which is the column header row. Similaril, column 0 is the row header column, and column 1 is the column next to it. This normally makes cell 1,1 (whose value can be seen as grid[1,1].Text) the first scrollable cell in either direction. Now if you hide the headers,say using grid.Model.Rows[0].Hidden = true, and similarily for the Cols[0], the above indexing is exactly the same. Cell 1,1 is still the first scrollable cell. (It is just the headers are hidden, but they still use index 0). Now form your question, I think you are not seeing this when you should. If you can upload a little sample showing the problem, we can probably explain what you are seeing. Now if you are using a hierarchical GridDataBoundGrid, then there are special column considerations in regard to multiple header rows and th eplus/minus column. If this is what you are seeing, then you can always use grid.Model.Cols.HeaderCount and grid.Model.Rows.HeaderCOunt to see where the real grid starts.

Keith Steinbeck
Replied On November 3, 2004 04:22 PM

Clay, This is what was happening. I was creating the grid as I described, and hiding the default row/column headers using Hidden = true. The reason I was getting the weird index values was that I was using ViewLayout.PointToClientRowCol and in the call there is a bool called "fixBackHidden". Initially it was set to true which gave me the skipped indexes (0,2,3,4). If it is set to false, the indexes run 1-4 and match those generated by the CellClick event for the cell in question. I can live with non-zero indexing now that this has been worked out. Thanks for the help. Keith

CONFIRMATION

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.

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.

;