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

KeyPress event can not execute

4 Answers 182 Views
GridView
This is a migrated thread and some comments may be shown as answers.
HamiD Mayeli
Top achievements
Rank 1
HamiD Mayeli asked on 22 Oct 2009, 06:19 PM
Hello,

I`m Using radGridview But KeyPress, KeyDown, CellPaint and Some one else doesn't execute.

Best Regards.

4 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 23 Oct 2009, 08:54 AM
Hi HamiD,

Thank you for contacting us. KeyPress and KeyDown events can't be used with RadGridView. You have to make your own GridBehavior class that inherits from BaseGridBehavior and override its ProcessKey event. Then, you have to set the GridBehavior property:

this.radGridView1.GridBehavior = new MyCustomGridBehavior();

Regarding the CellPaint event, you have to set EnableCustomDrawing to enable the event. I hope this helps. If you have more questions, just write us back.

Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
HamiD Mayeli
Top achievements
Rank 1
answered on 24 Oct 2009, 10:05 PM
Hi Jack,

Tanx for your helps, I will use that and if i have any question i will contact whit you, but now i have another question, I wanna to save Grid`s Filter so i used this code :
string strFilter = Grid.MasterGridViewTemplate.Filter.ToString() 
but Grid.MasterGridViewTemplate.Filter is readonly i wanna ask it i can do it with set a property with strFilter value, or i have to parse strFilter and use FilterExpression for each part of Filters.

at the end when Grid.Rows is empty and use this code
Grid.Rows.AddNew(Grid.Rows.NewRow()); 
Grid.CurrentRow was not indicate the new row properly

special tnax for your helps & with the best wishes
0
HamiD Mayeli
Top achievements
Rank 1
answered on 25 Oct 2009, 04:50 PM
Hello Jack,

I`m tried that you said but my grid dosn`t have GridBehavior property. I`m using q3 2008 winforms.

Regards Jack.
0
Jack
Telerik team
answered on 26 Oct 2009, 07:19 AM
Hello HamiD Mayeli,

Yes, this property is added in a more recent version of RadControls. I recommend that you try our latest release - Q2 2009 SP1. If you need assistance with the transition, we will be glad to help.

All the best,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
HamiD Mayeli
Top achievements
Rank 1
Answers by
Jack
Telerik team
HamiD Mayeli
Top achievements
Rank 1
Share this question
or