在列表框中添加多个列

编程入门 行业动态 更新时间:2024-10-12 18:16:49
本文介绍了在列表框中添加多个列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好. 我想通过3层体系结构将多个列添加到列表框.当前,一切正常,除了只添加一个列而不添加两个列.

Hi there. I want to add multiple columns to a Listbox through 3-tier architecture. Currently everything works fine except that it only adds one column and not the two.

WORKING CODE (PRESENTATION LAYER) lstClass = blayer.GetListClass((int)number, (string)name); listBox2.DataSource = lstClass; listBox2.ValueMember = "classId"; listBox2.DisplayMember = "className";

我想同时添加classId和className到列表框.我尝试了多种解决方案,但没有任何效果.有什么建议吗? 关于

I want to add both classId & className to the Listbox. I''ve tried multiple solutions but none work. Any advise please? Regards

推荐答案

ListBox不支持多列.使用ListView. ListBox doesn''t support multiple columns. Use a ListView.

listBox1.Items.Add("Class Id \ tClass Name"); 当我那样做时,它工作得很好,但是我无法通过3层对多个数据进行处理.谢谢Shameel.我会去的. 问候 listBox1.Items.Add("Class Id\tClass Name"); When i do it that way, it works perfectly fine but i cant do it for multiple data through 3-tier. Thank you Shameel. I will give it a go. Regards

更多推荐

在列表框中添加多个列

本文发布于:2023-10-28 04:56:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535582.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   框中   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!