请大家帮忙了,
我是BindingList作为数据源的,
已经设置
this.dataGridView1.AutoGenerateColumns = false;但是结果出来时还是会把所有数据源字段都自动显示一遍,图也发不上来,今天早上真实倒霉透顶了,
我是BindingList作为数据源的,
已经设置
this.dataGridView1.AutoGenerateColumns = false;但是结果出来时还是会把所有数据源字段都自动显示一遍,图也发不上来,今天早上真实倒霉透顶了,
解决方案 »
- Excel系统数据导入 Excel报表导出 请教高手
- asp.net调用Java写的WebService传递时间对象的问题?
- C# 这段代码没错,只是需要详细解释一下含义
- 100分,微软RDLC报表问题,有点困难
- C#多窗体的管理(非MDI)
- 关于c#中的form间引用传递后的使用问题
- 【求助】Word 2007 修改ribbon,需要动态获取XML(在线等)
- 调查一下有多少人准备跳槽或要找工作,就这年前这几天!
- winform Resources.resx Settings.settings app.config
- 一句话的问题!快来!!!!!!!!!!!!!
- c#判断日期中是否包含时间
- form2里水晶报表数据源调用form1里的dataset
你啊应该不会有问题的,除非你代码中有设置了AutoGenerateColumns的值
private void Init(SystemInfo systemInfo)
{
this.MySystemInfo = systemInfo;
ScheduleOper myoper = new ScheduleOper(MySystemInfo);
this.comboBox1.DisplayMember = "name";
this.comboBox1.ValueMember = "id";
this.comboBox1.DataSource = myoper.GetGroup(); DrawDataGridView1();
//构造函数这里,我打断点发现,combobox数据源赋值后,直接跳到下面的selectindexchange事件里面去了,在那里做了不该做的事情,回来再来画DrawDataGridView1();已经晚了。所以,先画DrawDataGridView1()就OK了
}
//选择组群
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int grouid = int.Parse(this.comboBox1.SelectedValue.ToString());
ScheduleOper myoper=new ScheduleOper (MySystemInfo );
this.myScheduleInfoList = myoper.GetSchedule(grouid);
this.dataGridView1.DataSource = this.myScheduleInfoList;
this.dataGridView1.Refresh();
}