Click here to Skip to main content
14,767,302 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have generated texboxes in header of the gridview for filtering the data...gridview is inside updatepanel...my main problem is when i enter something in textbox...gridview show the output data...but textbox lost its focus...so, i have to click another time on textbox...solve this issue please...textboxes generated by following rowcreated event

protected void gridview_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {

            TextBox txtsearch1;
            
            for (int i = 0; i < e.Row.Cells.Count; i++)
            {
                
                txtsearch1 = new TextBox();
                txtsearch1.ID = e.Row.Cells[i].Text;
                
                txtsearch1.Attributes["placeholder"] = e.Row.Cells[i].Text;
             
                e.Row.Cells[i].Controls.Add(txtsearch1);
            }
        }
    }
Posted
Updated 4-Jan-14 6:08am
v4
Comments
Karthik_Mahalingam 4-Jan-14 11:18am
   
post your full code regarding the text change event of the header textbox..etc..

1 solution

The Event where you are filtering the GridView, just try to set focus on the TextBox.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900