Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
form2 having datagridview I filter data from form1 textbox textchange by bindingsource
the datagridview are filter but how to get selected data from datagridview in form1 textbox. my code is below in text change event into form1.the bindingsource is public

C#
if (form1  == null)
            {
                form1 = new Form2(this);
                //fr.Close();
                form1.Show(this);
                
                form1.bs.Filter = string.Format("Product_Name Like '{0}*'",this.textBox1.Text);
                textBox1.Focus();
                textBox1.Text = form1.datapass2;
                //form1.Close();
                

            }
            else
            {
                form1.Close();
                form1 = null;
                form1 = new Form2(this);
                form1.Show(this);
                form1.bs.Filter = string.Format("Product_Name Like '{0}*'",this.textBox1.Text);
                textBox1.Text = form1.datapass2;
                textBox1.Focus();
            }
Posted
Updated 24-Nov-11 5:29am
v2
Comments
Dinesh Mani 25-Nov-11 5:51am    
The question isn't clear. Can you give more details?

BTW, I don't seem to find you having 2 forms, all I can see is Form2 and its instance form1 in the given code snippet.

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