I have the following code for each lookup table. So far I am doing copy/paste for each drop down list control. But I think there is a better way of doing this. I should be able to specify DataTextField, DataValueField, control names etc. Of course I will have to manually add configuration related database values on the database side like look up table, and other changes in the stored proc. But at the aspx page or .cs page, there has to be a better way then copy/paste..
<asp:TemplateField HeaderText="Your Ethnicity">
<EditItemTemplate>
<asp:DropDownList ID="ddlEthnicity" runat="server"
DataSourceid="ddlDAEthnicity"
DataTextField="Ethnicity" DataValueField="EthnicityID"
SelectedValue='<%#Bind("EthnicityID") %>'
>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate >
<asp:Label Runat="server" Text='<%# Bind("Ethnicity") %>'
ID="lblEthnicity">
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
Please let me know... Thanks