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?
AD
Administrator
Syncfusion Team
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.
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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.
AD
Administrator
Syncfusion Team
October 20, 2004 03:12 PM UTC
Thanks Clay. I don''t need to handle dragging, just selection. That will do just fine. Thanks.
AD
Administrator
Syncfusion Team
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.
AD
Administrator
Syncfusion Team
October 21, 2004 10:05 AM UTC