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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiple Row Headers don''t select properly

Thread ID:





20524 Oct 20,2004 01:05 PM UTC Oct 21,2004 10:05 AM UTC WinForms 7
Tags: GridControl
Administrator [Syncfusion]
Asked On October 20, 2004 01:05 PM UTC

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 02:17 PM UTC

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 02:20 PM UTC

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 02:26 PM UTC

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 03:08 PM UTC

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 03:12 PM UTC

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

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

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 10:05 AM UTC


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

Live Chat Icon For mobile
Live Chat Icon