View previous topic :: View next topic |
Author |
Message |
erikest
Joined: 30 May 2007 Posts: 17
|
Posted: Wed Aug 22, 2007 7:01 pm Post subject: Retrieving Screen Location of Selected Cell |
|
|
Is there a method for retrieving the screen location (left, top) of the currently selected cell in the tree? _________________ Erik Taylor
Developer
EnergySoft, LLC. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Aug 22, 2007 10:32 pm Post subject: |
|
|
Quote: | Is there a method for retrieving the screen location (left, top) of the currently selected cell in the tree? |
Not directly - why do you need this? Are you using SelectionMode.Cell?
[/quote] _________________ Infralution Support |
|
Back to top |
|
|
erikest
Joined: 30 May 2007 Posts: 17
|
Posted: Wed Aug 22, 2007 10:42 pm Post subject: |
|
|
I wish to display a context menu, similar to the one a user can display by right clicking on a tree element, when the user presses INS. It would be advantageous to set the location of the context menu to the currently selected tree element to provide consistent look when our users navigate and modify the tree using the keyboard instead of the mouse. _________________ Erik Taylor
Developer
EnergySoft, LLC. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Aug 23, 2007 10:35 pm Post subject: |
|
|
Virtual Tree automatically displays the row context menu when the Windows Cmd Key (typically found between the right Alt and Ctrl keys) is pressed. If you want to display this menu on some other key press you could derive from Virtual Tree and call the ProcessAppsCmdKey method which does this.
If you want to display some other context menu you can use the same logic as the ProcessAppsCmdKey does to find the location of the row. Because the PinnedPanel is protected you would need to do this in a derived class.
Code: |
Row row = FocusRow;
Point position = new Point(0, DisplayTop);
if (row != null)
{
RowWidget widget = PinnedPanel.GetRowWidget(row);
if (widget != null)
{
position = widget.Bounds.Location;
}
} |
_________________ Infralution Support |
|
Back to top |
|
|
|