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.

Multiple Row Headers don''t select properly

Thread ID:

Created:

Updated:

Platform:

Replies:

20524 Oct 20,2004 09:05 AM Oct 21,2004 06:05 AM Windows Forms 7
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 20, 2004 09:05 AM

I may be doing this wrong, but if I create a grid and do gridControl.Rows.HeaderCount = 1, then the second row of headers acts like regular cells in regard to selection, instead of acting like header cells. Is this the intended behavior or am I doing something wrong?

Administrator [Syncfusion]
Replied On October 20, 2004 10:17 AM

This is intended behavior. HeaderCount = 0 is the default 1-row header. Setting HeaderCount = 1, adds 1 extra HeaderRow and so on. HeaderCount is the index and the last HeaderRow in the zero-based row/col layout that the grid uses.

Administrator [Syncfusion]
Replied On October 20, 2004 10:20 AM

I''m sorry, I guess I wasn''t celar. I understand how HeaderCount works. My question is about why the second header row deals with selections like regular cells instead of like column header cells. In other words, if you click on a column header in the second row, you select the column header cell, not the column (assuming AllowSelection has GridSelectionFlags.Column). Pete

Administrator [Syncfusion]
Replied On October 20, 2004 10:26 AM

Let me go further and ask, if this is the intended selection behavior of a second row of column headers, how do I get the second row of column headers to handle selection like the first row? Pete

Administrator [Syncfusion]
Replied On October 20, 2004 11:08 AM

The col headers work the same way. Only the original header cell behaves like a header when you click it. If you want clicking a row1 header cell to select a column when you click it, you will have to handle it yourself. If it is just the click you want catch (as opposed to dragging selections), then you can handle the CellClick event and select teh columns your yourself if the click is on a header. If you want to handle dragging, then the way to try to do this is to replace the grid''s selection mouse controller with one of your own. If you have rthe source code, you could copy the original source into a class, and modify it to handle the headers differently.

Administrator [Syncfusion]
Replied On October 20, 2004 11:12 AM

Thanks Clay. I don''t need to handle dragging, just selection. That will do just fine. Thanks.

Administrator [Syncfusion]
Replied On October 21, 2004 04:31 AM

Just to place the information into this forum. Attached is a sample derived mouse controller class. In it, if you change bool bCol = (rowIndex <= 0 && colIndex > nhCol); bool bRow = (colIndex <= 0 && rowIndex > nhRow); bool bCell = (rowIndex > nhRow && colIndex > nhCol); bool bTable = (colIndex == 0 && rowIndex == 0); to bool bCol = (rowIndex <= nhRow && colIndex > nhCol); bool bRow = (colIndex <= nhCol && rowIndex > nhRow); bool bCell = (rowIndex > nhRow && colIndex > nhCol); bool bTable = (colIndex == 0 && rowIndex == 0); the controller will treat all headers the same.

Administrator [Syncfusion]
Replied On October 21, 2004 06:05 AM


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.

;