So here\'s the situation. I have a dropdownlist in a repeater that is inside a formview.
And the really special part is that the repeater is being used to add multiple r
If the value cant be set just int the drodownlist tag like...
SelectedValue='<%# Eval("ColumnWithValue")%>'
... then you need to work with OnItemDataBound
Basically:
On repeater tag, add this attribute:
OnItemDataBound="FormatRepeaterRow"
On page code-behind:
protected void FormatRepeaterRow(Object sender, RepeaterItemEventArgs e)
{
if( (e.Item.ItemType == ListItemType.Item) || ( e.Item.ItemType == ListItemType.AlternatingItem))
{
((DropDownList)e.Item.FindControl("ddlType")).SelectedValue = "a_value";
}
}