barbaratrize
New Member
I have a GridView that I want to be 10 rows high. The number of rows returned by the SQL query will vary, but will always be <=10 so I will need to add 10-rowcount empty rows to the end of the GridView. All of the examples I can find use a DataTable for the data source, but I am just using a SqlDataSource server control. Is there a way to add empty rows to this code?\[code\]<form id="form1" runat="server"><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CUBE %>" ProviderName="<%$ ConnectionStrings:CUBE.ProviderName %>" SelectCommand="SELECT csono, citemno, nordqty, nseq, nprice, cdescript, nsalesamt FROM dbo.sostrs WHERE (LTRIM(csono) = ?) ORDER BY nseq"> <selectparameters> <asp:controlparameter name="csono" controlid="frmSONum" propertyname="Text"/> </selectparameters></asp:SqlDataSource><asp:TextBox ID="frmSONum" runat="server"></asp:TextBox><asp:Button ID="Button1" runat="server" Text="Button" /><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None"> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:BoundField DataField="citemno" HeaderText="citemno" SortExpression="citemno" /> <asp:BoundField DataField="cdescript" HeaderText="cdescript" SortExpression="cdescript" /> <asp:BoundField DataField="nordqty" HeaderText="nordqty" SortExpression="nordqty" /> <asp:BoundField DataField="nprice" HeaderText="nprice" SortExpression="nprice" /> <asp:BoundField DataField="nsalesamt" HeaderText="nsalesamt" SortExpression="nsalesamt" /> </Columns> <EditRowStyle BackColor="#7C6F57" /> <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#E3EAEB" /> <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F8FAFA" /> <SortedAscendingHeaderStyle BackColor="#246B61" /> <SortedDescendingCellStyle BackColor="#D4DFE1" /> <SortedDescendingHeaderStyle BackColor="#15524A" /></asp:GridView></form>\[/code\]