I have a BaseListControl that contains an UltraGrid, and several class inheriting from it (we have several grids around the app).
The base has the row selection enabled by default - DisplayLayout.Override.CellClickAction is set to RowSelect. However, one of the inheriting classes requires CellSelect (for drag & drop functionality at cell level).
When I set:
myGrid.DisplayLayout.Override.CellClickAction = CellClickAction.CellSelect;
In the inheriting class' InitializeComponent, the MouseUp event does not fire (unless I click on a scroll bar or on a line drawn in between cells). But when I comment out the above line of code, MouseUp fires every time.
I should mention - MouseDown always fires, whether the above line is there or not.
Any help would be much appreciated.
Okay, I've done some poking around and it seems like the cell in the grid is getting the MouseUp message and not passing it on to anything else.
I tried a PreFilterMessage on the control containing the grid, and it only caught MouseUp as described above.
I guess what's happening is that the grid gets the MouseDown, and gives it to the appropriate cell, but then the cell becomes the active entity and keeps MouseUp to itself.
So, is there any way to get the cell to throw the mouse message up to it's parent?
Many thanks.
This KB article should help:
FAQ:Mouse events such as MouseDown, MouseUp, and DoubleClick do not fire when the mouse is over a cell that is in edit mode.
Thanks for the article. Unfortunately, it didn't work for me because the cells are not in edit mode!I eventually got the solution I wanted by stripping down the code in this article:http://forums.infragistics.com/forums/t/8075.aspxMy solution involved setting the following: Grid.AllowDrop = false; // I'm not dragging into the grid; I'm dragging to another object Grid.DisplayLayout.Override.SelectTypeCell = SelectType.SingleAutoDrag; Grid.DisplayLayout.Override.CellClickAction = CellClickAction.CellSelect;And then I only had to handle the SelectionDrag event, setting up the data that I wanted and then calling DoDragDrop.I guess I was trying to dive too deep - implementing my own dragging wasn't necessary.