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

Restrict/Suppress KeyStroke in radGridView

1 Answer 27 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hari
Top achievements
Rank 1
Hari asked on 25 Jun 2009, 02:18 PM
Hi,

I have developed a windows application in which I have used radGrid. There will be no user interaction through keyboard.
How can I restrict the keystrokes in radGridView.

 Key suppress is not working.I tried with Key_Down, Key_Up, Key_Press events of radGridView.

Ex: e.SuppressKeyPress = true

In which event should I handle this?

Thanks
Hari

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 26 Jun 2009, 06:33 PM
Hi Hari,

RadGridView has a GridBehavior property of type IGridBehavior. The run-time type that implements this interface by default is BaseGridBehavior. I would suggest creating a class which inherits BaseGridBehavior and overriding all methods related to the keyboard. In each you do nothing and do not call the base implementation. Once you have created the class you can set it like this:
 
public Form1()  
{  
    InitializeComponent();  
    // Create the new behavior in the form constructor for example.(assuming your class is named MyBehavior)  
    this.radGridView1.GridBehavior = new MyBehavior();  
 
Write back if you need further assistance.

Sincerely yours,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Hari
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or