Hi, based on your sample I am using grid mouseup event to open another dialog by clicking on grid column header, however i don't like column resize effecting same code. Any way to prevent this?
Thanks!
Current Code:
Private Sub Grid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Grid1.MouseUp
Dim mouseupColumn As UltraGridColumn
Try
' retrieve the Column from the UIElement
' retrieve the Row from the UIElement, important to prevent pop-up on non header click
Catch
End Try
If Not mouseupColumn Is Nothing AndAlso mouseupRow Is Nothing Then
Case "Blah"
objFrm.ShowDialog(Me)
End Select
End If
End Sub
AdjustableElement is part of the Infragistics PLF. So it applies to almost all of the Infragisics WinForms controls, not just the grid. :)
Awesomest, that helped a lot. Seems you know every line of code of the UltraGrid and how to use it. Big ups Mike !
Thanks Mike, great support!
Hi,
If you want to detect when the mouse is on the edge of a column you can check for an AdjustableUIElement. Try calling AdjustableElementFromPoint first, before you call ElementFromPoint. If AdjustableElementFromPoint returns null, continue with your existing code. If it does not return null, it means the mouse is currently over a resizing point and you should bail out.