Data binding 推出新的<;tr>;进入网格视图?

Data binding 推出新的<;tr>;进入网格视图?,data-binding,gridview,layout,Data Binding,Gridview,Layout,我想做的是创建第二行,它跨越GridView中的其他行。其思想是它是GridViewRow中的数据,比如第4列中的一个长varchar()。但当翻译成HTML时,我如何将其放在第二行 <table> <tr> <td></td> <th>ru sure?</th> <th>date</th> <th>category&

我想做的是创建第二行,它跨越GridView中的其他行。其思想是它是GridViewRow中的数据,比如第4列中的一个长varchar()。但当翻译成HTML时,我如何将其放在第二行

<table>
    <tr>
        <td></td>
        <th>ru sure?</th>
        <th>date</th>
        <th>category</th>
    </tr>
    <tr>
        <td rowspan="2"><a href=" ">edit</a></td>
        <td>yes</td>
        <td>"12/31/2009"</td>
        <td>website feedback</td>
    </tr>
    <tr>
        <td colspan="3"><textarea rows="3" cols="50"></textarea></td>
    </tr>
</table>

你确定吗?
日期
类别
对
"12/31/2009"
网站反馈

我可以处理单元格输出,但我不知道如何终止一行并开始另一行。从逻辑上讲,它仍然表示一行数据。

您看过ListView控件了吗?它允许一些非常复杂的布局

我使用的一种技术是将GridView的最后一个常规列作为TemplateField,然后将多余的行放在其中。例如,类似这样的内容:

<asp:GridView runat="server">
    <Columns>
        <asp:BoundField/>
        <asp:BoundField/>
        <asp:BoundField/>
        <asp:TemplateField>
            <ItemTemplate>
                <%#Eval("category")%>
            </td></tr>
            <tr><td colspan="3">
                <textarea rows="3" cols="50"></textarea>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>


是的,这可能有用,但我每行都需要它。它基本上代替了一列。这个解决方案将在网格的每一行下添加一行
colspan
。也就是说,绑定到网格的每个项目将有两行(一行有三列,一行有一列)。你在找不同的东西吗?