I am trying to set the value or text of a drop down to a value being pulled by the database, this is being passed through an Entity and when I debug i see the right hand side part of the code has the string value i want to match on the drop down but still when I do a step in and goes to the next line the left hand side still selects the — Select — item
I am trying to assign it as follows
ddlMyDropDown.SelectedItem.Text = Clients.MerchandiseType.ToString();
WHEN STEPPING THROUGH IT
ddlMyDropDown.SelectedItem.Text contains "--Select --"
Clients.MerchandiseType.ToString() contains "Sporting Goods"
ddlMyDropDown has an Item named “Sporting Goods” but it never selects it when I use the code above , I am not sure why. Is there anyway to achieve this?
I am not trying to change change any values , but to set the ddlMyDropDown to the Text in Clients.MerchandiseType.ToString(). The drop down will always have the text being passed on Clients.Merchandise.ToString();
Thank you
Not sure of the method names at the moment as i’m not at a pc with visual studios but here’s some hints.
Hope this helps.
If theres not a better answer tomorrow I will post a full solution.