Hello Morris
I gave up for about a year ago, when i locate the controll Xceed creates -
look at www.Xceed.com
It cost some, but it's great.
/Johnny Jensen
> Is there a way for a list or combo box (or anay simialr control) to
> display
[quoted text clipped - 6 lines]
> I remember in prior versio of VS the listbox supported multiple source
> columns and displayed them in multiple columns.
I have developed a custom combo that can handle 4 bound columns
Let me know if you want to take a look
> Is there a way for a list or combo box (or anay simialr control) to display
> multiple columns of items from multiple columns of the data source. I want
[quoted text clipped - 4 lines]
> I remember in prior versio of VS the listbox supported multiple source
> columns and displayed them in multiple columns.
Hi Morris,
Based on my understanding, you'd like to display multiple columns from
underlying data source in the ListBox or ComboBox. If I'm off base, please
feel free to let me know.
Firstly I don't remember in the prior version of Visual Studio, the ListBox
supported multiple source columns.
The ListBox class has a property named 'MultiColumn' and a multicolumn
ListBox places items into as many columns as are needed to make vertical
scrolling unnecessary. But this feature isn't relevant to supporting
multiple source columns.
ComboBox doesn't support multiple columns internally.
Actually what you want is to show text from multiple columns form the
underlying data source in a ListBox or ComboBox. A simple workaround is to
add a public property in the data entity class to return a text
representing the multiple columns text and set this new property to the
DisplayMember property of the ListBox or ComboBox.
I will illustrate this by an example.
class Person
{
private string id;
private string name;
private int age;
public string ID
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public int Age
{
get { return age; }
set { age = value; }
}
// this "Display" property is added only to return a text
representing the values of the 'Name' and 'Age' properties
public string Display
{
get { return (name + " " + age.ToString()); }
}
public Person(string id, string name, int age)
{
this.id = id;
this.name = name;
this.age = age;
}
}
private void Form1_Load(object sender, EventArgs e)
{
List<Person> lists = new List<Person>();
lists.Add(new Person("1","aara",34));
lists.Add(new Person ("2","bbb",42));
lists.Add(new Person("3", "ccc", 21));
this.comboBox1.DataSource = lists;
this.comboBox1.ValueMember = "ID";
this.comboBox1.DisplayMember = "Display";
this.listBox1.DataSource = lists;
this.listBox1.ValueMember = "ID";
this.listBox1.DisplayMember = "Display";
}
Hope this helps.
If my suggestion is not appropriate to your practice, please feel free to
let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Morris Neuman - 24 Aug 2007 19:04 GMT
Linda
Thank you for your answer to my question. But how would I accomplish the
same thing if I am using a Table adapter vs the List as the data source?

Signature
Thanks
Morris
> Hi Morris,
>
[quoted text clipped - 98 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu [MSFT] - 28 Aug 2007 13:14 GMT
Hi Morris,
Thank you for your reply!
> But how would I accomplish the same thing if I am using a Table adapter
vs the List as the data source?
Do you mean that you use a DataTable as the data source? If so, you could
add a computed column in the DataTable to return a string representing the
multiple columns values.
To do this, open the DataSet containing the DataTable in the designer and
add a column in the DataTable. Set the Expression property of the new
column to an expression, e.g. Column1 + ' ' + Column2, where Column1 and
Column2 are two columns in the DataTable.
Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Morris Neuman - 28 Aug 2007 15:20 GMT
Thanks again. I will try that.

Signature
Thanks
Morris
> Hi Morris,
>
[quoted text clipped - 18 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu [MSFT] - 30 Aug 2007 11:17 GMT
Hi Morris,
I am reviewing this post and would like to know the status of this issue.
If you have any question, please feel free to let me know.
Thank you for using our MSDN Managed Newsgroup Support Service!
Sincerely,
Linda Liu
Microsoft Online Community Support
kelly.pearson@ct.gov - 28 Aug 2007 16:27 GMT
On Aug 24, 12:51 am, v-l...@online.microsoft.com (Linda Liu [MSFT])
wrote:
> Hi Morris,
>
[quoted text clipped - 96 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Linda,
Is there an easy way to get the 'Display' property to line up the
fields?
For example, if you had a long name and a short name I would still
want the Age to appear underneath each other.
MyVeryLongName 42
MyShortName 37
not
MyVeryLongName 42
MyShortName 37
Thanks.