Reputation: 8646
I declared my template as follows
<EditItemTemplate>
<asp:DropDownList ID="ddlYear" runat="server" DataSource='<%#GetYears() %>' DataTextField="year" DataValueField="year"></asp:DropDownList>
</EditItemTemplate>
I need to bind the data from the function i used GetYears() i don't know how to function it can any one help me
I need the data for example name to be loaded in dropdown when i click on Edit of gridview is it the correct way or is there any best way to do this
Upvotes: 0
Views: 1445
Reputation: 685
in the code behind you can find dropdown using findcontrol method on the click of edit link and can bind easily.
Upvotes: 1
Reputation: 5129
You could create an objectDatasource on the page and then set the datasourceid to that objectDataSource. Then you can create your POCO class Look at this link for more info on objectdatasource http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/objectdatasource.aspx
Upvotes: 0