I'm using a repeater for a table in ASP.NET using C#
And I am trying to set the repeater to use a default of 26 rows.
No matter if I have more or less info.
If i have less, I want the rest of the row to be empty, if i have more then 26 rows of info it should go to a second, third, etc. page.
What should i do?
Here is my code
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="sqltoolinv1" >
<HeaderTemplate>
<table style="width: 86.7%; border-collapse: collapse; border: 1px solid black;" align="center">
<tr align="center" class="text" style="background-color: gray">
<th style="width: 5.14%;">No.</th>
<th style="width: 20.22%;">Tool Nomenclature or Description</th>
<th style="width: 11.4%;">Purchase Date</th>
<th style="width: 9.56%;">Original Cost</th>
<th style="width: 9.93%;">Condition of Tool</th>
<th style="width: 8.456%;">Drawer or Shelf</th>
<th style="width: 21.32%;">Remarks</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr align="left">
<td>
<asp:Label runat="server" ID="lbnum"
Text='<%# Eval("ID") %>' /></td>
<td>
<asp:Label runat="server" ID="lbtname"
Text='<%# Eval("Description") %>' /></td>
<td>
<asp:Label runat="server" ID="lbpurdate"
Text='<%# Eval("[Purchase_Date]") %>' /></td>
<td>
<asp:Label runat="server" ID="lboricost"
Text='<%# Eval("Cost") %>' DataFormatString="{0:C}" /></td>
<td>
<asp:Label runat="server" ID="lbtoolcond"
Text='<%# Eval("Condition") %>' /></td>
<td>
<asp:Label runat="server" ID="lbshelf"
Text='<%# Eval("Location") %>' /></td>
<td>
<asp:Label runat="server" ID="lbremarks"
Text='<%# Eval("Remarks") %>' /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="sqltoolinv1" runat="server"
ConnectionString="<%$ connectionstrings:webserverconnectionstring %>"
SelectCommand="SELECT [ID],[Description],[Purchase Date] AS [Purchase_Date],[Cost],[Condition],[Location],[Remarks] FROM [EmpPortalToolInv] WHERE [Payroll] = @Payroll ORDER BY [ID]">
<SelectParameters>
<asp:SessionParameter Name="Payroll" SessionField="Payroll" DbType="String" />
</SelectParameters>
</asp:SqlDataSource>