我有一个包含 12 列的 DataGrid,我试图将前 6 列放在一行中,将其余列放在另一行中,使其看起来像这样:
我使用了两个单独的 DataGrid,但如果有不止一行,它看起来像这样:
如果我只使用一个 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>