我想实现:选择CB控件中的一项“张三”,在DGV控件中显示“张三”的“性别”“班级”信息 我的CB代码: List<test> source = new List<test>(); test t1 = new test() { Id = 1,DisplayName = "张三"}; source.Add(t1); test t2 = new test() { Id = 2, DisplayName = "李四" }; source.Add(t2);DGV代码:DataGridViewTextBoxColumn c1 = new DataGridViewTextBoxColumn(); c1.HeaderText = "性别"; c1.DataPropertyName = "Sex"; gvSetting.Columns.Add(c1);DataGridViewTextBoxColumn c2 = new DataGridViewTextBoxColumn(); c2.HeaderText = "班级"; c2.DataPropertyName = "Class"; gvSetting.Columns.Add(c2);在CB控件的SelectedIndexChanged事件中写什么代码才能实现啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货