private void BindCombox4(GridColumnCollection dcl) { List <frmSort.SortCol> list = new List <frmSort.SortCol>(); frmSort.SortCol item = new frmSort.SortCol { valueMember = "0", textMember = "无..." }; list.Add(item); for (int i = 0; i < dcl.Count; i++) { if (dcl[i].Visible) { frmSort.SortCol item2 = new frmSort.SortCol { valueMember = dcl[i].FieldName, textMember = dcl[i].Caption }; list.Add(item2); } } this.comboBox4.DataSource = list; this.comboBox4.DisplayMember = "textMember"; this.comboBox4.ValueMember = "valueMember"; }
private void BindCombox1(DataGridViewColumnCollection dcl) { List <frmSort.SortCol> list = new List <frmSort.SortCol>(); for (int i = 0; i < dcl.Count; i++) { if (dcl[i].Visible) { frmSort.SortCol item = new frmSort.SortCol { valueMember = dcl[i].Name, textMember = dcl[i].HeaderText }; list.Add(item); } } this.comboBox1.DataSource = list; this.comboBox1.DisplayMember = "textMember"; this.comboBox1.ValueMember = "valueMember"; }
private void BindCombox1(DataGridViewColumnCollection dcl) { List<frmSort.SortCol> list = new List<frmSort.SortCol>(); for (int i = 0; i < dcl.Count; i++) { if (dcl[i].Visible) { frmSort.SortCol item = new frmSort.SortCol { valueMember = dcl[i].Name, textMember = dcl[i].HeaderText }; list.Add(item); } } this.comboBox1.DataSource = list; this.comboBox1.DisplayMember = "textMember"; this.comboBox1.ValueMember = "valueMember"; }
private void BindCombox4(GridColumnCollection dcl) { List<frmSort.SortCol> list = new List<frmSort.SortCol>(); frmSort.SortCol item = new frmSort.SortCol { valueMember = "0", textMember = "无..." }; list.Add(item); for (int i = 0; i < dcl.Count; i++) { if (dcl[i].Visible) { frmSort.SortCol item2 = new frmSort.SortCol { valueMember = dcl[i].FieldName, textMember = dcl[i].Caption }; list.Add(item2); } } this.comboBox4.DataSource = list; this.comboBox4.DisplayMember = "textMember"; this.comboBox4.ValueMember = "valueMember"; }