我有一个购物车项目的网格视图,它是在运行时绑定的,现在我的要求是我想要网格中的两个标题行,如下图所示,这怎么可能?谁能帮我?
我的网格设计 http://content.screencast.com/users/Pr6546/folders/Default/media/f7da2da4-f80e-4674-b1d4-0ccd872966d2/Capture.PNG http://www.screencast.com/t/g4HkqlSpx
下面是我的网格源
<asp:GridView ID="gvCheckOutItems" GridLines="None" ShowFooter="true" DataKeyNames="Item_No"
Width="100%" border="0" CellSpacing="0" CellPadding="5" AutoGenerateColumns="false"
CssClass="Checkout-Grid" runat="server" OnRowCreated="gvCheckOutItems_RowCreated">
<Columns>
<asp:TemplateField HeaderStyle-Width="7%">
<ItemTemplate>
<asp:LinkButton ID="lnkBtnRemove" runat="server" OnClick="lnkBtnRemove_Click" Text="Remove"
CssClass="blue-link"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Item No" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
DataField="Item_No" HeaderStyle-Width="7%" />
<asp:BoundField HeaderText="Title" HeaderStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" DataField="Title" HeaderStyle-Width="25%" />
<asp:BoundField HeaderText="Offered By" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
DataField="Trainer" HeaderStyle-Width="16%" FooterText="<strong>Order Total</strong>" />
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtItemFormat" runat="server" Text='<%# Eval("Item_Format") %>'
Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Format" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
DataField="Format" HeaderStyle-Width="15%" />
<asp:BoundField HeaderText="Duration" ItemStyle-HorizontalAlign="Right" DataField="Duration"
HeaderStyle-Width="7%" />
<asp:TemplateField HeaderStyle-Width="7%" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
FooterStyle-HorizontalAlign="Right" HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox ID="txtQuantity" Enabled="false" CssClass="quantity" Text='<%#Eval("Quantity")%>'
onblur="fnquantityEmpty(this)" onkeyup="extractNumber(this,0,false);" onkeypress="return blockNonNumbers(this, event, false, false);"
runat="server" MaxLength="4" AutoPostBack="true" OnTextChanged="Qty_Changed"></asp:TextBox>
</ItemTemplate>
<FooterTemplate>
<strong>
<asp:Label ID="lblFooterQuantity" runat="server"></asp:Label></strong>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center"
HeaderStyle-Width="7%">
<ItemTemplate>
<asp:Label ID="lblPrice" runat="server" Text='<%#getConvertedPrice(Eval("Price")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtItemOwnerID" runat="server" Text='<%# Eval("ItemOwnerID") %>'
Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"
FooterStyle-HorizontalAlign="Right" HeaderStyle-Width="8%">
<ItemTemplate>
<asp:Label ID="lblSubTotal" runat="server" Text='<%#getConvertedPrice(Eval("Subtotal")) %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<strong>
<asp:Label ID="lblFooterTotalPrice" runat="server" Text="" ToolTip="Total"></asp:Label></strong>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
问候