One way I have done this is to create a template column that contains both the control that I want the users to see, and a hidden literal to hold the lookup value:
<asp:templatecolumn>
<asp:literal runat="server" id="litValue" text='<%# binding code... %>' visible="false" />
<asp:dropdownlist runat="server" id="ddlChoices" ...></asp:dropdownlist>
</asp:templatecolumn>
Then in my editcommand handler for the grid, I preset the ddl item based on the value that's in the literal control.
ddlChoices = CType(e.Item.FindControl("ddlChoices"), DropDownList)
litValue = CType(e.Item.FindControl("litValue"), Literal)
ddlChoices.SelectedIndex = ddlChoices.Items.IndexOf(ddlChoices.Items.FindByVa lue(litValue.Text))
|