Grid header double click
Hello,
I would like to know how to detect the double click event of grid header.
My program needs to display popup form when double click in the grid row. Grid also allow sorting. My problem is that when user accidentally double click in the grid header to sort column, the popup form is showing. I don't want to display popup form when column sorting. Is there any dapfor grid features or functions that can detect the grid header double click or any other way to solve this. Can you please suggest me how can I achieve this.
Thanks in advance...
0
-
Hi,
You can easily specify UI elements for which you want to display the menu. Look at the following example:
grid.DoubleClick += delegate
{
switch (grid.HitTest(grid.PointToClient(Cursor.Position)))
{
case HitTestInfo.Cell:
case HitTestInfo.CellHorizontalSeparator:
case HitTestInfo.CellVerticalSeparator:
case HitTestInfo.EmptyBottom:
case HitTestInfo.ExpansionButton:
case HitTestInfo.GroupRow:
case HitTestInfo.RowEmptyRight:
case HitTestInfo.RowHierarchicalIndent:
case HitTestInfo.RowSelector:
contextMenu.Show(Cursor.Position);
break;
}
};Best regards,
Dapfor
0
Please sign in to leave a comment.
Comments
1 comment