Author: Fleeb | Posted on: 6/23/2009 9:16:56 AM | Views : 327

Hello all!
 
I have this issue that boggles me. Let me illustrate:
 
I have a DataGrid containing a DropDownList. During the DataGrid row data bound event, I populate the DropDownList with some values from a data source. After which, I assigned the selected value.
 
ddlList.Items.AddRange(...);
ddlList.SelectedValue = someValue;
 
The weird thing here is, when viewing this page in the browser, the selected value is not the REAL selected value codewise. For example, if I have two possible choices or list items (ListItem1, ListItem2) for around say 5 rows:
Row SelectedValue Rendered SelectedValue 1 ListItem1 ListItem2 2 ListItem1 ListItem2 3 ListItem2 ListItem2 4 ListItem2 ListItem2< ...

Go to the complete details ...