Combox数据应在数据网格视图中查看 [英] Combox data should view in data grid view

查看:76
本文介绍了Combox数据应在数据网格视图中查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



朋友们请帮帮我

我希望在选择combox时,数据应在数据网格"视图中查看.我必须对两个表进行内部联接.

例如:-如果我在combox中选择公司名称,然后在网格视图中单击提交",则我应该能够看到公司数据.


请帮助我解决这个非常紧急的问题
我希望我已经正确解释了我想要的内容

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

推荐答案

本文- ^ ]对构建网格过滤器下拉列表应该对您很有用.
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.


在按钮上单击,我已编写此代码
它开始工作

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;


这篇关于Combox数据应在数据网格视图中查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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