This is a migrated thread and some comments may be shown as answers.

Question: How do I determine what object I clicked on in the grid

2 Answers 17 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jorge Gonzalez
Top achievements
Rank 1
Jorge Gonzalez asked on 02 Feb 2010, 03:09 PM
Hello,
     There was a function called hittest that I used in another grid that I worked with that allowed me to determine if a cell had been clicked on or a column or row header had been clicked on. Does this grid have such a function?
Thanks 

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Feb 2010, 03:22 PM
Hi,

Here is an example:

public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();

            RadGridView1.AddHandler(RadGridView.MouseLeftButtonUpEvent, new MouseButtonEventHandler(RadGridView1_MouseUp), true);

        }

        private void RadGridView1_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var element = ((System.Windows.RoutedEventArgs)(e)).OriginalSource;
        }
}

Regards,
Vlad
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Jorge Gonzalez
Top achievements
Rank 1
answered on 02 Feb 2010, 03:45 PM
Excellent! Thanks Vlad
Tags
GridView
Asked by
Jorge Gonzalez
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jorge Gonzalez
Top achievements
Rank 1
Share this question
or