R
rwoo_98
I am working on a web form that allows the user to add a new row.
Basically I query the data from a database and store it in a dataset.
I add a new row to the table in the dataset:
DataRow dr = objDataSet.Tables[0].NewRow();
objDataSet.Tables[0].Rows.Add(dr);
When I bind the data to a datagrid I see the blank row. When I bind
the data to my repeater, I don't see the blank row. Any ideas why?
Here is the html
<table border=3>
<ASP:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<tr bgcolor="#BDC0C7">
<td width="16%" class="ary_header">Title</td>
<td width="16%" class="ary_header">ISBN</td>
<td width="16%" class="ary_header">Publication Date</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bordercolor=#006600>
<td class="alignC"><%# DataBinder.Eval(Container.DataItem, "Title")
%></td>
<td class="alignC"><%# DataBinder.Eval(Container.DataItem, "ISBN")
%></td>
<td class="alignC"><%# DataBinder.Eval(Container.DataItem,
"PublicationDate", "{0}") %></td>
</tr>
</ItemTemplate>
</ASP:Repeater>
</table>
Basically I query the data from a database and store it in a dataset.
I add a new row to the table in the dataset:
DataRow dr = objDataSet.Tables[0].NewRow();
objDataSet.Tables[0].Rows.Add(dr);
When I bind the data to a datagrid I see the blank row. When I bind
the data to my repeater, I don't see the blank row. Any ideas why?
Here is the html
<table border=3>
<ASP:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<tr bgcolor="#BDC0C7">
<td width="16%" class="ary_header">Title</td>
<td width="16%" class="ary_header">ISBN</td>
<td width="16%" class="ary_header">Publication Date</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bordercolor=#006600>
<td class="alignC"><%# DataBinder.Eval(Container.DataItem, "Title")
%></td>
<td class="alignC"><%# DataBinder.Eval(Container.DataItem, "ISBN")
%></td>
<td class="alignC"><%# DataBinder.Eval(Container.DataItem,
"PublicationDate", "{0}") %></td>
</tr>
</ItemTemplate>
</ASP:Repeater>
</table>