Click here to Skip to main content
16,023,339 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 28-Mar-16 20:53pm
Comments
CHill60 28-Mar-16 7:23am    
Use the Improve question link to post the code that you have tried and explain why it isn't working.
And please don't use text-speak, many people will ignore questions that contain "plzz plz" so you are limiting the number of members who can help

am using windows application..
i use below code
C#
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;
                    }
                }
            }


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..
 
Share this answer
 

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