具有多列 (C#) 的 WinForms 组合框? [英] WinForms combobox with multiple columns (C#)?

查看:19
本文介绍了具有多列 (C#) 的 WinForms 组合框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用以下代码来填充组合框:

I am using currently the following code to populate a combobox:

combobox.DataSource = datatable;
combobox.DisplayMember = "Auftragsnummer";
combobox.ValueMember = "ID";

有没有办法显示多列.我为 DisplayMember 尝试了Auftragsnummer、Kunde、Beschreibung",但没有奏效.

Is there a way to display multiple columns. I tried "Auftragsnummer, Kunde, Beschreibung" for DisplayMember but it did not work.

推荐答案

您不能有多个列.虽然您可以将多个字段串联起来作为显示成员

You can't have multiple columns. Though you can have concatenation of multiple fields as Display Member

退房:如何绑定 Combo 以便显示成员连接源数据表的 2 个字段?

这篇关于具有多列 (C#) 的 WinForms 组合框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆