Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

Friends please help me out

I want on the selection of the combox the data should view in Data grid view. i have to do inner join of the two table.

Ex:- If i select company name in combox and the click on submit in grid view i should able to see the company data.


Please help me on this its very urgent
I hope i have explain properly what i want
Posted
Comments
Thilina Chandima 2-Apr-12 22:40pm    
please explain more.

if your looking for an event you can use combobox selection change event. if you looking for a data fill, you can use data binding option in .net.

please give us more detail then we can give you good answer.
sonu_coder 2-Apr-12 23:47pm    
i am looking for click event
Nilesh Patil Kolhapur 3-Apr-12 0:59am    
give some code which u try
sonu_coder 3-Apr-12 1:49am    
I have use comboBox in the i have directly add the database same thing done with data grid view in that i have use one button i am not getting how i work with that ?

This article - Building a Drop-Down Filter List for a DataGridView Column Header Cell[^] should be useful to you in building a filter dropdown for a grid.
 
Share this answer
 
On the button click i have written this code
and it start working

DataTable dt = new DataTable();
            SqlCommand cmd = new SqlCommand(" select * from magazinesectionmaster where mid =" + comboBox1.SelectedValue.ToString() + " order by section_name", sc);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            dataGridView1.DataSource = dt;
            //dataGridView1.DataBindings();
            dataGridView1.Visible = true;
 
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