Adding more display fields to a listbox's .displaymember property?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I have a listbox on a screen that gets populated from a sqlce table using a
sqlcedataadaptor. My question is this:

How can I add more than one display field to the listbox's

.DisplayMember property?

I want to display two fields from the datatable in the list box (ie. #1 -
20ac.). The #1 comes from one field in the table and the 20ac. comes from
another field in the table.

Thanks in advance,
 
It's not easy with ListBox as it's not designed for that, but you can use
DataGrid or ListView instead



--
Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Unless I missed something I cannot find the .DisplayMember property in the
ListView control.

I am having to use the .DisplayMember property along with the .ValueMember
property. I did not see this property in the ListView control either.

What I need to do is this, if there is another alternative:

1) Need to display two values in a listbox (ie. #1 - 20ac.)
2) When user clicks on that value in the list box I need it to use the table
id for the #1 value as an index id to some other child tables.

Any thoughts on this?

------------------------------------------
Noble D. Bell
AgForest Partners, Inc.



Ilya Tumanov said:
It's not easy with ListBox as it's not designed for that, but you can use
DataGrid or ListView instead



--
Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
This should help you out:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=490411&SiteID=1

--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

Noble Bell said:
Unless I missed something I cannot find the .DisplayMember property in the
ListView control.

I am having to use the .DisplayMember property along with the .ValueMember
property. I did not see this property in the ListView control either.

What I need to do is this, if there is another alternative:

1) Need to display two values in a listbox (ie. #1 - 20ac.)
2) When user clicks on that value in the list box I need it to use the
table
id for the #1 value as an index id to some other child tables.

Any thoughts on this?

------------------------------------------
Noble D. Bell
AgForest Partners, Inc.
 
Back
Top