从更新的gridview内的动态生成的文本框中失去焦点 [英] lost focus from dynamically generated textbox inside updated gridview

查看:89
本文介绍了从更新的gridview内的动态生成的文本框中失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview的标题中生成了texbox,用于过滤数据... gridview在updatepanel内...我的主要问题是当我在文本框中输入内容时... gridview显示输出数据...但文本框丢失了它的重点......所以,我必须在文本框上点击另一个时间...请解决这个问题...通过以下rowcreated事件生成的文本框



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);
            }
        }
    }

推荐答案

您要过滤<$ c $的事件c> GridView ,只是尝试将焦点设置在 TextBox
The Event where you are filtering the GridView, just try to set focus on the TextBox.


这篇关于从更新的gridview内的动态生成的文本框中失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆