Is there some way to set the focus when editing in a GridView row?

K

keithb

Is there some way to set the focus when editing a row in GridView control?

Thanks,

Keith
 
Joined
Aug 14, 2006
Messages
1
Reaction score
0
Setting focus on gridview while editing

here is a code you can use for setting focus on gridview Edit link while editing

put this code in function
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{

if (e.Row.RowType == DataControlRowType.DataRow && (e.Row.RowState & DataControlRowState.Edit) != 0)
{
Control c = e.Row.Cells[9].Controls[0];
this.SetFocus(c);
}

}

Hope this helps!!! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top