3 Answers, 1 is accepted
0
Hello Andrew L,
Thank you for contacting us. I am not sure that I understand your question. Please describe the desired behavior in greater detail. You can override the default grid behavior and handle the ProcessKey method. This way you can intercept when the user presses the Space key. If this is the case, please consider the code below:
I hope this helps.
Greetings, Jack
the Telerik team
Thank you for contacting us. I am not sure that I understand your question. Please describe the desired behavior in greater detail. You can override the default grid behavior and handle the ProcessKey method. This way you can intercept when the user presses the Space key. If this is the case, please consider the code below:
this
.radGridView1.GridBehavior =
new
CustomGridBehavior();
public
class
CustomGridBehavior : BaseGridBehavior
{
public
override
bool
ProcessKey(KeyEventArgs keys)
{
if
(keys.KeyCode == Keys.Space)
{
MessageBox.Show(
"Hello world!"
);
return
true
;
}
return
base
.ProcessKey(keys);
}
}
I hope this helps.
Greetings, Jack
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0

Andrew L
Top achievements
Rank 1
answered on 02 Sep 2010, 12:17 PM
Hello Jack ,
In code I have two different RadGridView, and one CustomGridBehaviour for this controls. Both of RadGridView have CommandColumns. Every of columns doing something else, how can I activate that what is set to active CommandCollumn when I press Space ? Can I do that with GridBehaviour or maybe I must do thise for all RadGridView without GridBehaviur
Andrew L
In code I have two different RadGridView, and one CustomGridBehaviour for this controls. Both of RadGridView have CommandColumns. Every of columns doing something else, how can I activate that what is set to active CommandCollumn when I press Space ? Can I do that with GridBehaviour or maybe I must do thise for all RadGridView without GridBehaviur
Andrew L
0
Hello Andrew L,
You cannot click the current command button by using the grid API. However, you can identify it by using the CurrentCell property:
I hope this helps.
Kind regards,
Jack
the Telerik team
You cannot click the current command button by using the grid API. However, you can identify it by using the CurrentCell property:
public
override
bool
ProcessKey(KeyEventArgs keys)
{
if
(keys.KeyCode == Keys.Space)
{
GridCommandCellElement cell = GridControl.CurrentCell
as
GridCommandCellElement;
if
(cell !=
null
)
{
//...
}
return
true
;
}
return
base
.ProcessKey(keys);
}
I hope this helps.
Kind regards,
Jack
the Telerik team
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 Public Issue Tracking
system and vote to affect the priority of the items