5 Answers, 1 is accepted
0
Hello Sajeev,
Thank you for writing.
Here is how to set the focus to the first cell in the new row in RadGridView, when another row is added:
I hope this helps.
Greetings,
Stefan
the Telerik team
Thank you for writing.
Here is how to set the focus to the first cell in the new row in RadGridView, when another row is added:
void
radGridView1_UserAddedRow(
object
sender, GridViewRowEventArgs e)
{
radGridView1.MasterView.TableAddNewRow.Cells[0].BeginEdit();
}
I hope this helps.
Greetings,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
sajeev ks
Top achievements
Rank 1
answered on 17 Oct 2012, 08:58 AM
Itz Not Working........
AM Using Telerik RadControls 2011 Q1
Only working first time....
Next item added But Not Set focs cell(0).
plz give me correct answer...
any way Thanks for responding................
AM Using Telerik RadControls 2011 Q1
Only working first time....
Next item added But Not Set focs cell(0).
plz give me correct answer...
any way Thanks for responding................
0
sajeev ks
Top achievements
Rank 1
answered on 17 Oct 2012, 09:52 AM
IF ADDNEWROW POSITION=BOTTOM This code is working
grd.MasterView.TableAddNewRow.Cells(1).BeginEdit()
But POSTION TOP Not working
grd.MasterView.TableAddNewRow.Cells(1).BeginEdit()
But POSTION TOP Not working
0
Accepted
Hello Sajeev,
In this case, please consider replacing the default grid behavior with the following one:
Let me know how this works for you.
Greetings,
Stefan
the Telerik team
In this case, please consider replacing the default grid behavior with the following one:
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
radGridView1.Columns.Add(
"ada"
);
for
(
int
i = 0; i < 10; i++)
{
radGridView1.Rows.Add(10,
"test"
,
"test"
);
}
radGridView1.GridBehavior =
new
MyBehavior();
}
}
class
MyBehavior : BaseGridBehavior
{
public
override
bool
ProcessKey(KeyEventArgs keys)
{
if
(
this
.GridControl.CurrentRow
is
GridViewNewRowInfo)
{
if
(keys.KeyData == Keys.Enter || keys.KeyData == Keys.Down || keys.KeyData == Keys.Up)
{
this
.GridControl.EndEdit();
this
.GridControl.GridNavigator.SelectPreviousRow(1);
this
.GridControl.GridNavigator.SelectFirstColumn();
this
.GridControl.BeginEdit();
}
else
if
(
this
.GridControl.GridNavigator.IsLastColumn(
this
.GridControl.CurrentColumn) && keys.KeyData == Keys.Tab)
{
this
.GridControl.EndEdit();
this
.GridControl.GridNavigator.SelectPreviousRow(1);
this
.GridControl.GridNavigator.SelectFirstColumn();
this
.GridControl.BeginEdit();
}
else
if
(keys.KeyData == Keys.Tab)
{
this
.GridControl.GridNavigator.SelectNextColumn();
}
return
true
;
}
else
{
return
base
.ProcessKey(keys);
}
}
}
Let me know how this works for you.
Greetings,
Stefan
the Telerik team
You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
0
sajeev ks
Top achievements
Rank 1
answered on 03 Dec 2012, 07:31 AM
THANK YOU VERY MUCH...........
ITZ WORING..............
Thanks Dude.......!
ITZ WORING..............
Thanks Dude.......!