regulardude
Programmer
I have dynamically populated serveral comboboxes on the form load in this manner:
My problem is that when I export to XML, I am not getting the results I want.
Instead of getting the ID/ValueMember, I am getting the DisplayMember.
How do I get the ID/ValueMember to be exported to XML?
Thanks
Code:
// Populate Rating ComboBox
ds_Lookups.dt_RatingRow newRatingRow =
ds_Lookups.dt_Rating.Newdt_RatingRow();
newRatingRow.ID = "5";
newRatingRow.Description = "Outstanding";
ds_Lookups.dt_Rating.Rows.Add(newRatingRow);
newRatingRow = ds_Lookups.dt_Rating.Newdt_RatingRow();
newRatingRow.ID = "4";
newRatingRow.Description = "Above Average";
ds_Lookups.dt_Rating.Rows.Add(newRatingRow);
propRatingComboBox.ValueMember = "ID";
propRatingComboBox.DisplayMember = "Description";
propRatingComboBox.DataSource = ds_Lookups.dt_Rating;
My problem is that when I export to XML, I am not getting the results I want.
Instead of getting the ID/ValueMember, I am getting the DisplayMember.
How do I get the ID/ValueMember to be exported to XML?
Thanks