我想绑定ComboBox
到DataTable
(我不能改变其原来的架构)如何绑定ComboBox,以便displaymember是源数据表的2个字段的连续字符串?
cbo.DataSource = tbldata;
cbo.DataTextField = "Name";
cbo.DataValueField = "GUID";
cbo.DataBind();
我想ComboBox
显示tbldata.Name + tbldata.Surname
。
过程中添加的新名称+姓作为一个领域的tbldata
只是结合之前是可能的,但我希望为沿(伪)的线条更为优雅的解决方案
cbo.DataTextField = "Name";
cbo.DataTextField += "Surname";
我同意,不能想别的办法 – AlexDrenea 2009-06-17 11:54:25
由于这是一个简单的只使用,使用类作为基础,这是矫枉过正。 – callisto 2009-06-17 12:17:59
我的意思是如果一个班级已经在使用。 – 2009-06-17 12:37:31