I have a grideview that is being populated by an ObjectDataSource. In the EditItemTemplate, I have a dropdownlist which gets populated thru the code behind on the RowDataBound event:
ddStates.DataSource = snm.getStates();
ddStates.DataTextField = "State";
ddStates.DataValueField = "StateID";
ddStates.DataBind();
Now, what i would like to do is set the selected index of my dropdownlist to the current value for the row from the objectDataSource. How do I get the StateID from the ObjectDataSource?
Thanks, I have been running in circles on this one.
You could always use row’s
DataItemto get the underlyingDataSource: