TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
marikaludmann
NA
6
0
ListBox, multiple display members
Jun 11 2004 7:03 AM
I have a dataset/datatable and trying to get it to get the rows of the table to display in a ListBox. My code so far String disp = dt_shared.Columns["FirstName"].ToString() + " " + dt_shared.Columns["LastName"].ToString(); listBox1.DataSource = dt_shared; listBox1.DisplayMember = disp; listBox1.ValueMember = "Email1Address"; listBox1.DataBindings.Add("SelectedValue",dt_shared,"Email1Address"); dt_shared is the datatable and I am trying to first attempt display the FirstName, LastName and EmailAddress on one line, Second attempt (which is not shown here), also display other attributes in the table as part of the Display member. I thought if I can create a string disp, then I can just assign this to DisplayMember and get FirstName, LastName and EmailAddress Displayed. However, it is only displaying the last element (EmailAddress) in the ListBox. How can I have more than one display member? Marika
Reply
Answers (
4
)
Menu Bar logo
Delete FileDialog