Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,

Can any one please let me know how the Auto complete works in Mdi child form ?

I have created the simple windows from in that the below code is working fine but the same code if i implement it to MDI Child form then the same suggestion is not working?

C#
using (OleDbConnection con = new OleDbConnection(ConString))
                {
                    OleDbCommand cmd = new OleDbCommand("Select ConsigneeName From tblConsignee", con);
                    OleDbDataReader dReader;
                    SqlConnection conn = new SqlConnection();
                    con.ConnectionString = ConString;
                    con.Open();
                    dReader = cmd.ExecuteReader();

                    if (dReader.HasRows == true)
                    {
                        while (dReader.Read())
                            namesCollection.Add(dReader["ConsigneeName"].ToString());
                    }
                    else
                    {

                    }
                    dReader.Close();
                    txtConsigneeName.AutoCompleteCustomSource = namesCollection;
                    txtConsigneeName.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                    txtConsigneeName.AutoCompleteSource = AutoCompleteSource.CustomSource;
                }
Posted
Updated 9-Oct-13 2:20am
v2
Comments
ganesh89_babu 9-Oct-13 7:32am    
sorry Bro!! actually i also trying the same thing if you found let me Know
sayeed bagban 9-Oct-13 7:35am    
Ok buddy

1 solution

 
Share this answer
 
v2
Comments
sayeed bagban 9-Oct-13 7:37am    
I used the same code also but it is not working for MDI Child form but the same it works for Normal windows form...

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