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

RadGridView Hearder Click

1 Answer 87 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 02 Dec 2015, 01:57 PM
Hi,

I need to do some action when the user clicks with the right button on the radgridview, but ignoring header clicks.

How can I identify header clicks?

 

PS: I'm using MouseClick event.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Dec 2015, 02:13 PM
Hello Rafael,

Thank you for writing.

Here is a sample code snippet demonstrating how to detect mouse clicks over RadGridView excluding header cells:
private void radGridView1_MouseDown(object sender, MouseEventArgs e)
{
    GridHeaderCellElement elementUnderMouse = this.radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridHeaderCellElement;
    if (elementUnderMouse == null && e.Button== System.Windows.Forms.MouseButtons.Right)
    {
        Console.WriteLine("MouseDown");
    }
}

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ChartView
Asked by
Rafael
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or