
Hi,
When I click on addNewItem Of rad Frid.
How to place the Focus on First Control of inserted
If column is GridBound Column like as follows
<telerik:GridBoundColumn DataField="Address1" UniqueName="Address1" HeaderText="<%$ Resources:lbl_Employee_Address1 %> " ShowFilterIcon="false"
EditFormColumnIndex="0" Visible="false" >
</telerik:GridBoundColumn>
Could some one please help me regarding this.
I really appreciate it.
Thanks in advance
--Prathyusha
4 Answers, 1 is accepted

Try the following code snippet to achieve your scenario.
C#:
protected
void
rad_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditFormItem && e.Item.IsInEditMode && e.Item.OwnerTableView.IsItemInserted)
{
GridEditFormItem item = (GridEditFormItem)e.Item;
TextBox txt = (TextBox)item[
"EmployeeID"
].Controls[0];
txt.Focus();
}
}
Thanks,
Princy.

I tried this solution
But focus is not staying , when I clicked on the Add new item.
Here is the code
If there is any mistake please let me know.
<
telerik:GridBoundColumn DataField="BankName" UniqueName="BankName" HeaderText="<%$ Resources:lbl_Employee_BankName %>"
EditFormColumnIndex="0">
</telerik:GridBoundColumn>
if
(e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.OwnerTableView.IsItemInserted)
{
GridEditFormItem item = (GridEditFormItem)e.Item;
TextBox txt = (TextBox)item["BankName"].Controls[0];
// EmployeeBankAccountRadGrid.Controls.Add(new LiteralControl
//(String.Format("<script type='text/javascript'>document.getElementById('{0}').focus();document.getElementById('{0}').scrollIntoView();</script>", item.FindControl("BankName").ClientID)));
txt.Focus();
}
For template column it is working, If I use javascript code which in the above code. But same code is not working for GridBound column.
Could some one please suggest either of way to fix this issue.
Thank you.

Try the following code library approach to access the Template column control form client side.
Retrieving grid editor value client side.
Thanks,
Shinu.

Is there any way we can do same thing for GridBoundColumn.
If any one have idea, how do it for Gridbound column, Please suggest me.
Thanks
Prathyusha