View previous topic :: View next topic |
Author |
Message |
phil
Joined: 12 May 2006 Posts: 1
|
Posted: Fri May 12, 2006 2:25 pm Post subject: Column-depending ContextMenu |
|
|
Dear Support
I have to show a ContextMenu depending on the Row and the Column. Is there any way to get the Column as well as the Row from the GetContextMenuEventArgs?
tree_GetContextMenu(object sender, GetContextMenuEventArgs e)
{
// how to get the col?
}
Thanx
Philipp |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri May 12, 2006 11:21 pm Post subject: |
|
|
You can't get the column directly from the event args. But you can find it out by getting the widget currently under the mouse. If this is a CellWidget then you get the column from it eg
Code: | private void _virtualTree_GetContextMenu(object sender, GetContextMenuEventArgs e)
{
Point pos = this.PointToClient(Control.MousePosition);
Widget widget = _virtualTree.GetWidget(pos.X, pos.Y);
if (widget is CellWidget)
{
Column column = (widget as CellWidget).Column;
}
} |
_________________ Infralution Support |
|
Back to top |
|
|
|