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

GridView question

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mariusz
Top achievements
Rank 1
Mariusz asked on 20 Dec 2007, 01:05 PM

I'm workin with RadControls for WinForms. I have two questions about GridView.
First - how to turn off default ContextMenuStrip which appears after I click r-mouse button and hold it?
Second - I don't know if it's an error but after migration from Q2 filter text box (most right) is in front of the scrollbar (previously it wasn't)


1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 21 Dec 2007, 01:48 PM
Hello Mariusz Sadza,

Thank you for writing us.

You can customize the context menu of RadGridView by subclassing from the grid and overriding the OnMouseDown event. This behavior is described in the following sample:

public class MyGridView : RadGridView 
    protected override void OnMouseDown(MouseEventArgs e) 
    { 
        if (e.Button == MouseButtons.Right) 
        { 
            RadDropDownMenu menu = new RadDropDownMenu(); 
            menu.Items.Add(new RadMenuItem("Item 1")); 
            menu.Items.Add(new RadMenuItem("Item 2")); 
            menu.Items.Add(new RadMenuItem("Item 3")); 
            menu.Show(this, e.Location); 
        } 
        else 
        { 
            base.OnMouseDown(e); 
        } 
    } 
 
    public override string ThemeClassName 
    { 
        get 
        { 
            return typeof(RadGridView).FullName; 
        } 
        set 
        { 
        } 
    } 

We will add a more convenient API for this purpose in our future releases.

In some cases the TextBox is displayed on top of the scroll bar. We managed to reproduce this behavior locally, and it will be addressed in our upcoming release.

Should you have any further questions, do not hesitate to write us.

Kind regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Mariusz
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or