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
Adam azhari
NA
12
2.6k
How to set valueMember for combobox items C#
Jun 6 2020 1:03 PM
I had to find out how to set values into ComboBox items
So i have a combo box with two string items and each item make some changes on other combo box then save to xml
Now i tried to set value for this items but the problem is the xml output shows only 1 value
comReg.DisplayMember =
"Item 1"
;
comReg.ValueMember =
"1"
;
comReg.DisplayMember =
"Item 2"
;
comReg.ValueMember =
"2"
;
comPer.Items.Clear();
switch
(comReg.SelectedItem.ToString()) {
case
"Item 1"
:
comPer.Items.AddRange(
new
string
[]{
"1"
,
"2"
,
"3"
,
"4"
});
break
;
case
"Item 2"
:
comPer.Items.AddRange(
new
string
[]{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
});
break
;
Reply
Answers (
1
)
How can i get output in true or false in SQL
How to read data from serial ports /USB ?