Current filter:
                                You should refresh the page.
                                  • Hello,
                                    in the TcxDBVerticalGrid i set the dragmode to dmManual
                                    In the MouseDown Event i call TcxDBVerticalGrid(Sender).BeginDrag(False, 10)
                                    after these call the MouseUp event is Fired, even though I still hold the mouse button pressed.
                                    How can i change this?
                                    I want the MouseUP event only if I release the mouse button.

                                • Ingvar (DevExpress Support) 09.21.2011

                                  Hello Edgar.
                                  Thank you for your message. This behavior is not directly related to our controls and can be reproduced by using any TControl descendant. The issue is caused by the fact that the BeginDrag method fires the OnMouseUp event immediately:

                                  procedure TControl.BeginDrag(Immediate: Boolean; Threshold: Integer); ... if csLButtonDown in ControlState then begin GetCursorPos(P); P := ScreenToClient(P); Perform(WM_LBUTTONUP, 0, Longint(PointToSmallPoint(P))); //<<<HERE end;

                                  I am afraid we cannot fix this behavior at the level of our components. The only possible way is to explicitly exclude the csLButtonDown element from the VerticalGrid's ControlState property:

                                  procedure TForm1.cxVerticalGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin TcxVerticalGrid(Sender).ControlState := TcxVerticalGrid(Sender).ControlState - [csLButtonDown]; TcxVerticalGrid(Sender).BeginDrag(false, 10); end;

                                  Please note that this approach has a limitation. The OnMouseUp event will never fire. In this case, you can use the OnEndDrag event, instead.
                                  Hopefully, my explanation is clear.
                                  Best regards,

                                0 Solutions

                                Creation Date Importance Sort by