I've got a DropDownList that's populated dynamically. Values are set to unique ID's from a database, and the text is a corresponding string from the same database row.
If I know what ID value should be selected, how do I go about setting the SelectedIndex property of the list? For example, the list might be populated with five or six items, and all I know is that one of them has a value of 1354. How do I make sure that it is selected without knowing where in the list it is going to show up? I'm sure it's something very simple, as always!
If I know what ID value should be selected, how do I go about setting the SelectedIndex property of the list? For example, the list might be populated with five or six items, and all I know is that one of them has a value of 1354. How do I make sure that it is selected without knowing where in the list it is going to show up? I'm sure it's something very simple, as always!