bounding for dropdown list in datagrid

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

Hello,

I put a dropdown list in ItemTemplate Column. I can select its value from
the dropdown list and store in a dataset, but when I retrieve records from
dataset, it doesn't show up in the datagrid. Is there anything I missed? and
where can I find something for reference?

Thanks.

Here is html code snippets.
<asp:datagrid id="dgProduct" style="Z-INDEX: 102; LEFT: 5px; POSITION:
absolute; TOP: 301px" runat="server" AutoGenerateColumns="False"
DataKeyField="ProductId" Width="100%">
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="Product Name">
<ItemStyle Font-Size="X-Small"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Product Code">
<ItemTemplate>
<asp:DropDownList id="ddlCode" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
 
Back
Top