Hii i have a dropdownlist in gridview coloum.
I wants to add values in dropdownlist from database..!!
how can i do it?plzz tell me..
Gridview code is below??
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField HeaderText="Product_ID">
<ItemTemplate>
<asp:Label id="idlbl" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"id")%>' >
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product_Name">
<ItemTemplate>
<asp:Label id="idlbl" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"id")%>' >
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product_Image">
<ItemTemplate>
<asp:Label id="idlbl" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"id")%>' >
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product_Qty">
<ItemTemplate>
<asp:DropDownList ID="ddl" runat ="server" DataTextField ="Product_Qty" DataValueField ="id" DataSourceID ="SqlDataSource1" >
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product_Rates">
<ItemTemplate>
<asp:Label id="idlbl" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"id")%>' >
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Database table is...below and i wants to add Product_Size Values into Dropdownlist.
CREATE TABLE [dbo].[Productmaster](
[product_Id] [int] IDENTITY(1,1) NOT NULL,
[product_Name] [nvarchar](max) NOT NULL,
[product_Image] [nvarchar](max) NOT NULL,
[product_Size] [int] NOT NULL,
[product_Rate] [int] NOT NULL,
CONSTRAINT [PK_Productmaster] PRIMARY KEY CLUSTERED
(
[product_Id] ASC
)