我有一个数据表,有3个领域,其中我需要把第2和第3个领域的价值观结合起来,并在 com盒中显示。 我的做法与目前的做法一样。
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Col1", typeof(string));
dt.Columns.Add("Col2", typeof(string));
Enumerable.Range(1, 10).ToList().ForEach(i => dt.Rows.Add(i, string.Concat("Col1", i), string.Concat("Col2", i)));
comboBox1.DataSource = dt;
comboBox1.DisplayMember = string.Format("{0} : {1}","Col1","Col2");
但我正在将产出作为<编码>System.Data.DataRowView。
即便如此,我也不能从所储存的程序水平改变。 然而,我可以采用实体办法处理某些财产,但目前情况会发生巨大变化。 是否有任何机制可以将数据表作为来源并完成这项工作。
Thanks