Divelements Community
Customer discussion of all Divelements products

SandGrid / TreeView - ContextMenu Item?

Latest post 09-15-2008 14:43 by TheGoodNamesWereGone. 2 replies.
  • 09-12-2008 10:59

    SandGrid / TreeView - ContextMenu Item?

    I don't know whether I'm being an idiot, but I can't figure out how to reference the node in a TreeView on a Right Click (it doesn't select so SelectedElements doesn't work).

    Any help much appreciated!

  • 09-15-2008 8:57 In reply to

    Re: SandGrid / TreeView - ContextMenu Item?

    Here's an example of getting the row that was clicked from the MouseUp event.

    private void sandGridFolders_MouseUp(object sender, MouseEventArgs e)
    {
        
    if (e.Button == MouseButtons.Right)
        {
           
    GridRow row = sandGridFolders.GetElementAt(sandGridFolders.PointToGrid(new Point(e.X, e.Y))) as GridRow;
            if (row != null)
                MessageBox.Show(row.ToString());
        }
    }

  • 09-15-2008 14:43 In reply to

    Re: SandGrid / TreeView - ContextMenu Item?

    Fantastic - thanks very much for that Tim. I'd got as far as the MouseButtons.Right  but couldn't figure out the next bit.

    Thanks so much.

     

Page 1 of 1 (3 items) | RSS
Copyright © 2008 Divelements Limited
Powered by Community Server (Commercial Edition), by Telligent Systems