B
Bas Jaburg
Hello,
I have populated a datagrid on my aspx page with data from the
database. The datagrid also has TemplateColumn with a textbox to enter
the quantity in. If I submit, the data in that column seems to be
empty. It's not the Postback thing, I already checked that. All the
other data is there, but the freshly entered data is not.
The grid looks something like this:
<asp:datagrid id="dgProducts" runat="server">
<Columns>
<asp:BoundColumn DataField="ID" HeaderText="ID"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
(so this one has two columns)
If I try to read it using:
foreach (DataGridItem item in dgProducts.Items)
{
Response.Write (item.Cells[1].Text);
}
it shows nothing!
What am i doing wrong?
Help greatly appreciated.
Regards
Bas Jaburg
I have populated a datagrid on my aspx page with data from the
database. The datagrid also has TemplateColumn with a textbox to enter
the quantity in. If I submit, the data in that column seems to be
empty. It's not the Postback thing, I already checked that. All the
other data is there, but the freshly entered data is not.
The grid looks something like this:
<asp:datagrid id="dgProducts" runat="server">
<Columns>
<asp:BoundColumn DataField="ID" HeaderText="ID"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
(so this one has two columns)
If I try to read it using:
foreach (DataGridItem item in dgProducts.Items)
{
Response.Write (item.Cells[1].Text);
}
it shows nothing!
What am i doing wrong?
Help greatly appreciated.
Regards
Bas Jaburg