在datagridview中自动完成 [英] Auto complete in datagridview

查看:79
本文介绍了在datagridview中自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

请我解决我的问题..提前谢谢..

我有一个文本框,点击文本框会显示一个数据网格。 grid包含两列,即UserName和Role。如果我单击一个单元格或行,所选的UserName将显示在文本框中。它的工作正常..我的问题是,如果我在文本框中键入一个字母,数据网格应填充匹配的UserName,这是自动完成...我试过很多..但没有得到任何解决方案... plzz plz帮助我.. :(

我正在使用C#.net



我尝试了什么:



亲爱的先生,

请我解决我的问题..提前谢谢..

i有一个文本框,点击文本框一个数据网格将显示。网格包含两列,即UserName和Role。如果我单击一个单元格或行,所选的UserName将显示在文本框中。它工作正常..我的问题是如果我在文本框中键入一个字母,datagrid应该填充匹配UserName是自动完成的...我试过很多..但没有得到任何解决方案... plzz plz帮助我.. :(

我正在使用C#.net

Dear Sir,
please me to solve my problem..thanks in advance..
i have a textbox and by clicking the textbox a datagrid will display. grid contain two columns namely UserName and Role. if i click in a cell or row the selected UserName will displayed in the textbox. it works fine.. my problem is if i type a letter in textbox, the datagrid should populate matching UserName that is auto complete...i tried alot..but didnt get any solutions...plzz plz help me.. :(
am working with C#.net

What I have tried:

Dear Sir,
please me to solve my problem..thanks in advance..
i have a textbox and by clicking the textbox a datagrid will display. grid contain two columns namely UserName and Role. if i click in a cell or row the selected UserName will displayed in the textbox. it works fine.. my problem is if i type a letter in textbox, the datagrid should populate matching UserName that is auto complete...i tried alot..but didnt get any solutions...plzz plz help me.. :(
am working with C#.net

推荐答案

http:// www。 aspdotnet-suresh.com/2012/09/9- top-ajax-jquery-autocomplete.html [ ^ ]



http://www.aspdotnet-suresh.com/2012/09/9-top-ajax-jquery-autocomplete.html [ ^ ]



使用JQuery Ajax和Asp.Net WCF服务自动完成 - C#和Vb.Net [ ^ ]
http://www.aspdotnet-suresh.com/2012/09/9-top-ajax-jquery-autocomplete.html[^]

http://www.aspdotnet-suresh.com/2012/09/9-top-ajax-jquery-autocomplete.html[^]

AutoComplete using JQuery Ajax and Asp.Net WCF Service – C# and Vb.Net[^]


我正在使用Windows应用程序..

i使用以下代码

am using windows application..
i use below code
private void txtCustmrName_TextChanged(object sender, EventArgs e)
        {
            int txtLen = this.txtCustmrName.Text.Length;
            // --- DataGridView Loop
            string unme;
            for (int myRow = 0; myRow <= dguser.Rows.Count - 1; myRow++)
            {
                unme=dguser.Rows[myRow].Cells[1].Value.ToString();
               dguser.Rows[myRow].Visible = false;
                if (unme.Length < txtLen)
                {
                    continue;
                }
                //if ((DataGridView(0, myRow).Value.ToString.Length < txtLen))
                //{
                //    continue;
                //}
                else
                {
                    if (unme.Substring(0, txtLen) == txtCustmrName.Text)
                    {
                        dguser.Rows[myRow].Visible = true;
                    }
                }
            }





显示



与货币经理的头寸相关联的行不能隐藏。

unme = dguser.Rows [myRow] .Cells [1] .Value.ToString( );这段代码......



it shows

"Row associated with the currency manager's position cannot be made invisible."
this error in "unme=dguser.Rows[myRow].Cells[1].Value.ToString();" this code..


这篇关于在datagridview中自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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