0
我需要在页脚模板中彼此之下的总数。应该有数据行,直到第5列后无网格线,然后再总上校网格视图格式化
后网格线下面是ASPX代码:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" SelectedRowStyle-BackColor="AliceBlue"
ShowFooter="True" EnableModelValidation="True"
onrowdatabound="LineItemGrid_RowDataBound" onrowcommand="GridView1_RowCommand" CellSpacing="0"
style="border-width:2px;border-style:Solid;font-weight:bold;width:1050px;">
<Columns>
<asp:TemplateField HeaderText="xxx">
<ItemTemplate>
<asp:Label ID="lbl1" runat="server" Text='Label' ></asp:Label>
</ItemTemplate>
<asp:TemplateField HeaderText="yyyy">
<ItemTemplate>
<asp:Label ID="lbl2" runat="server" Text='Label' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
///....Two other template fields here....
</asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lbltotal" runat="server" Text='' ></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox runat="server" ID="txttotalprice" ReadOnly="true" Width="100px" BorderStyle="None" ></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Pleaes帮助我如何在页脚模板中应用以下要求的格式...
似乎它并没有我,你是需要分页,排序或任何特定的Gridview功能。在这种情况下,为什么不建立自己的HTML表格并按照您的要求进行设计?只是一个想法。 –
寻呼将包括在内 – Janet
这并不是那么简单。你应该看的是GridView_RowDataBound事件。每次绑定一行时,都会触发此事件,并从传递的Row对象中访问单元。然后你可以遍历每个单元格并设置一个CSS样式。使用不同类型的控件可能会更容易,但是,正如您所说,您可能需要分页等 – dash