select an radlistbox item by right click the mouse

2 posts, 0 answers
  1. Mohan
    Mohan avatar
    11 posts
    Member since:
    Jul 2012

    Posted 11 Feb 2013 Link to this post

    Hi ,
              I am using rad listbox for display the data and having context menu by right click the listbox.
    I am having problem in selected item by right click(not selected if any other item by right clicking).
    please give solution for this.
  2. Mohan
    Mohan avatar
    11 posts
    Member since:
    Jul 2012

    Posted 11 Feb 2013 Link to this post

    private void radListBox1_MouseDown(object sender, MouseEventArgs e)
          {
              if (e.Button == MouseButtons.Right)
              {
                  RadElement clickedItem = radListControl2.ElementTree.GetElementAtPoint(e.Location) as RadElement;
                  if (clickedItem != null)
                  {
                      RadListBoxItem dataItem = clickedItem as RadListBoxItem;
                      MessageBox.Show("Right Clicked " + dataItem.Text);
                  }
              }
          }

  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top