我有一个包含12列的DataGrid,我试图将前6列放在一行中,其余列放在另一行中,以便它看起来像这样:
我使用了两个独立的DataGrids但是如果有多行,它看起来像这样:
如果我只使用一个DataGrid,有没有办法添加一个中断线或新线来移动一些列?
代码:
<asp:DataGrid CssClass="tblResults" runat="server" ID="dgNightline" AutoGenerateColumns="false" >
<HeaderStyle CssClass="tblResultsHeader" />
<AlternatingItemStyle BackColor="#EEEEEE" />
<Columns>
<asp:BoundColumn DataField="FirstDocketNo" HeaderText="Cons No"></asp:BoundColumn>
<asp:BoundColumn DataField="JobNo" HeaderText="Job No"></asp:BoundColumn>
<asp:BoundColumn DataField="CustRef" HeaderText="Cust Ref"/>
<asp:BoundColumn DataField="DeliverDate" HeaderText="Date"/>
<asp:BoundColumn DataField="CollectionAddressName" HeaderText="Collect From"></asp:BoundColumn>
<asp:BoundColumn DataField="DdeliverToShortAddress" HeaderText="Deliver To"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid CssClass="tblResults" runat="server" ID="dgNightline2" AutoGenerateColumns="false">
<HeaderStyle CssClass="tblResultsHeader" />
<AlternatingItemStyle BackColor="#EEEEEE" />
<Columns>
<asp:BoundColumn DataField="Description" HeaderText="Description"></asp:BoundColumn>
<asp:BoundColumn DataField="PieceBreakDown" HeaderText="Qty"></asp:BoundColumn>
<asp:BoundColumn DataField="GrossWeight" HeaderText="Gross Wgt"/>
<asp:BoundColumn DataField="ChgWeight" HeaderText="Chg Wgt"/>
<asp:BoundColumn DataField="DelAmt" HeaderText="Amt"/>
</Columns>
</asp:DataGrid>