How to add blank row in grid view?

前端 未结 3 804
余生分开走
余生分开走 2021-01-27 02:04

I am new to the ASP.NET i am binding one list of data object to the grid view. I want to display blank row after each record in grid view so i have done this by as below in code

相关标签:
3条回答
  • 2021-01-27 02:35

    Write a stored procedure to get Output Parameter from sql server and bind to grid view if record is not there..

    0 讨论(0)
  • 2021-01-27 02:45

    You can't have an empty row in the Datagrid if it isn't present in the data source. You have to think that after all the grid data is just a representation of your data source, if there is a empty row, the grid will show it, if there is not, it wont.

    0 讨论(0)
  • 2021-01-27 02:49

    Try This

    <div>
    <asp:DataList ID="DataList1" runat="server">
        <ItemStyle ForeColor="#4A3C8C" BackColor="#E7E7FF"></ItemStyle>
        <HeaderTemplate>
            <table width="900px">
                <tr>
                    <td width="300px">
                        <b>Name</b>
                    </td>
                    <td width="300px">
                        <b>Account No</b>
                    </td>
                    <td width="300px">
                        <b>Company</b>
                    </td>
                </tr>
            </table>
        </HeaderTemplate>
        <ItemTemplate>
            <table width="900px">
                <tr>
                    <td align="left" width="300px">
                        <%# DataBinder.Eval(Container.DataItem, "Name")%>
                    </td>
                    <td align="left" width="300px">
                        <%# DataBinder.Eval(Container.DataItem, "AccountNo")%>
                    </td>
                    <td align="left" width="300px">
                        <%# DataBinder.Eval(Container.DataItem, "Company")%>
                    </td>
                </tr>
                <tr>
                    <td align="left" width="300px">
                        <br />
                    </td>
                    <td align="left" width="300px">
                        <br />
                    </td>
                    <td align="left" width="300px">
                        <br />
                    </td>
                </tr>
            </table>
        </ItemTemplate>
        <HeaderStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="#4A3C8C"></HeaderStyle>
         <SeparatorTemplate><br /></SeparatorTemplate>
    </asp:DataList>
    </div>
    
    0 讨论(0)
提交回复
热议问题