tags:

views:

5

answers:

0

Hi,

I need to create editable gridview custom conrol. If all the fields are text box releted fields it is working fine. In some cases i need to display dropdown list. How can i bind data to the dropdown list?

Since it is custom control i can't able to staticlly bind in the rowdatabound event. And i have tried to the below one

<EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="campaigns" DataTextField="campaignName" DataValueField="campaignID" SelectedValue='<%# Bind("campaignName", "{0}") %'> </asp:DropDownList> </EditItemTemplate>

The DatasourceId "campaigns" is the datatable which is loaded in the page load even. But it is also not worked.