I've given up on getting the DropDownList to work. I tried a simple ListBox with the same result. The mere presence of these controls causes any changes in the grid to produce a full postback and repaint. I've switched to using a RadioButtonList since I only have to display 0, 1, 2 as choices. So what I have on the page is:
<asp:TemplateField HeaderText="Execution Group">
<itemstyle cssclass="centerAll"/>
<itemtemplate>
<asp:RadioButtonList id="radGroupNum" runat="server" RepeatDirection="Horizontal"
OnSelectedIndexChanged="radGroupNum_SelectedIndexChanged" AutoPostBack="true" >
</asp:RadioButtonList>
</itemtemplate>
</asp:TemplateField>
On the code behind there is method to handle the RowDataBound event which does this to populate the lists and pick the right selection for each row:
RadioButtonList list = args.Row.FindControl("radGroupNum") as RadioButtonList;
if (list != null)
{
foreach (ExecutionGroup group in executionGroups)
{
list.Items.Add(new ListItem(group.GroupNumber.ToString()));
}
list.DataBind();
list.SelectedValue = ((BusinessActionInfo)args.Row.DataItem).ExecutionGroupNumber.ToString();
}
and finally...
protected void radGroupNum_SelectedIndexChanged(object sender, EventArgs e)
{
RadioButtonList groupList = sender as RadioButtonList;
GridViewRow row = (GridViewRow)groupList.NamingContainer;
BusinessActionInfo baInfo = (BusinessActionInfo)grdBusinessActions.Data[row.RowIndex];
baInfo.ExecutionGroupNumber = short.Parse(groupList.SelectedValue);
consoleService.UpdateBusinessActionInfoGroupNumber(baInfo);
}
I'm posting all this in case it helps anyone else.