private void lSheet_SelectedIndexChanged(object sender, EventArgs e) { if (lSheet.EditValue == null) { return; } List <string> cols = IEx.GetCol(lSheet.EditValue.ToString()); if (cols == null) { return; } RiCom.Items.AddRange(cols.ToArray()); MapStruct = new DataTable(); MapStruct.Columns.Add("FieldName", typeof(string)); MapStruct.Columns.Add("ColName", typeof(string)); DataRow dr = MapStruct.NewRow(); dr["FieldName"] = "MaVt"; MapStruct.Rows.Add(dr); dr = MapStruct.NewRow(); dr["FieldName"] = "GiaBan"; MapStruct.Rows.Add(dr); gridControl1.DataSource = MapStruct; gridControl1.DataMember = MapStruct.TableName; }
private void lSheet_SelectedIndexChanged(object sender, EventArgs e) { if (lSheet.EditValue == null) { return; } List <string> cols = IEx.GetCol(lSheet.EditValue.ToString()); if (cols == null) { return; } foreach (DataRow dr in MapStruct.Rows) { if (cols.Exists(x => x.ToString().ToUpper() == dr["FieldName"].ToString().ToUpper())) { dr["ColName"] = dr["FieldName"].ToString(); } if (dr["FieldName"].ToString().ToUpper() == "SOCT") { dr["SoCT"] = true; } } RiCom.Items.AddRange(cols.ToArray()); foreach (DataRow dr in MapStructDT.Rows) { if (cols.Exists(x => x.ToString().ToUpper() == dr["FieldName"].ToString().ToUpper())) { dr["ColName"] = dr["FieldName"].ToString(); } } if (MapStructVAT != null) { foreach (DataRow dr in MapStructVAT.Rows) { if (cols.Exists(x => x.ToString().ToUpper() == dr["FieldName"].ToString().ToUpper())) { dr["ColName"] = dr["FieldName"].ToString(); } } } riCom1.Items.AddRange(cols.ToArray()); RiCom2.Items.AddRange(cols.ToArray()); }
private void lSheet_SelectedIndexChanged(object sender, EventArgs e) { if (lSheet.EditValue == null) { return; } List <string> cols = IEx.GetCol(lSheet.EditValue.ToString()); if (cols == null) { return; } RiCom.Items.AddRange(cols.ToArray()); }