In our grid, we have a hierarchical layout. We''ve modified selection so that when the parent row of a hierarchy is selected, so are its children. We''ve also modified it so that selecting a cell, selects the entire row (and if that row is a parent, its children as well)
Whena child row is selected, only the child row should be selected.
Where I have a problem is in the following situation: If I click on the parent row header, the parent and all children are selected. If I then click on one of the child rows'' row headers, I don''t get the SelectionChanging event.
If I click on a cell other than the row header in that row, then I get the SelectionChanging event and everything works fine.
Any idea why clicking on the child row''s row header isn''t working?
ADAdministrator Syncfusion Team October 21, 2004 07:19 PM UTC
Is this a hierarchical GridDataBoundGrid or something else?
About the only reason I can think of that would cause the click to be ignored is if the cell has style.Enabled = false for the header cell.
One thing you might try is to use a debug build of our libraries, and put a stop in the grid''s OnMouseDown or OnGridControlMouseDown, and try to catch the mousedown in the problem situation. Then you might be able to step through the code to see why the OnSelectionsChanging is not being hit.
If you can post a sample project showing the problem, we can try to spot something here.
ADAdministrator Syncfusion Team October 21, 2004 11:29 PM UTC
Okay, after tracing through it, I discovered the cause of the problem. So here it is, and I still need a solution.
The renderer for my row headers handles OnHitTest. In the OnHitTest, I set the cursor to a regular arrow cursor and return 1.
My requirements specify that in this grid, it must use a regular arrow. This was the only way I could find to do it. And by doing this, for some reason, it doesn''t send the selectionchanging even when the cell (In this case, a row header) is in the current selection.
Setting the cursor to the regular arrow and returning 0 causes the arrow cursor to flicker for a second, but otherwise sticks to the old right arrow cursor.
So, if you can provide me with a different way of changing the cursor to a regular arrow over my header cell, even though the cell is selectable, without returning a 1 in OnHitTest, then you will have solved my problem.
ADAdministrator Syncfusion Team October 22, 2004 06:39 AM UTC
Another way to display a special cursor is to derive the grid and overriding OnSetCursor. Here is a sample. You would add some checks to only make the change over the headers.