I have a grid call RadGridArea, in the PreRender event, I need to set the grid into edit mode in the
page load. But I want to set the focus to an aspTextBox control.
How can I do? please help.
protected void RadGridArea_PreRender(object sender, EventArgs e)
{
PropertyArea projarea = new PropertyArea();
DataTable dt = projarea.GetPropertyAreaByPropertyId(this.property_id);
if (dt.Rows.Count == 0)
{
for (int i = 0; i < this.RadGridArea.Items.Count; i++)
{
this.RadGridArea.MasterTableView.Items[i].Edit = true;
}
this.RadGridArea.Rebind();
}
if (!Page.IsPostBack)
{
string s = "<script type='text/javascript'>document.getElementById('" + this.txtPropertyName.ClientID + "').focus();</script>";
ClientScript.RegisterStartupScript(Page.GetType(), Guid.NewGuid().ToString(), s, false);
}
}
The above coding is not work.
Regards,
Paul