0

我想在网格视图中显示标题文本的值总和。

代码:

.aspx

<asp:GridView ID="gvTrHty" runat="server" AutoGenerateColumns="false" Width="100%"
                            Style="border: 0px solid #cdcdcd; background-color: #cdcdcd;" border="0" CellSpacing="1"
                            CellPadding="3" OnSorting="gvTrHty_Sorting" AllowSorting="true">
<Columns>
<asp:TemplateField HeaderText="S.No" ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center">
  <ItemTemplate>
       <%#Container.DataItemIndex+1 %>
  </ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Employee" DataField="UserFullName" SortExpression="UserFullName" />
<asp:BoundField HeaderText="Course" DataField="CourseName" SortExpression="CourseName" />
<asp:BoundField HeaderText="Duration(Hrs)" DataField="Duration" SortExpression="Duration" />
<asp:BoundField HeaderText="Start Date" DataField="StartDate" DataFormatString="{0:dd-MMM-yyyy}"
                                    SortExpression="StartDate" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" />
<asp:BoundField HeaderText="End Date" DataField="EndDate" DataFormatString="{0:dd-MMM-yyyy}"
                                    SortExpression="EndDate" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" />
<asp:BoundField HeaderText="Result" DataField="RESULT" ItemStyle-HorizontalAlign="Center"
                                    SortExpression="RESULT" ItemStyle-VerticalAlign="Middle" />
 <asp:BoundField HeaderText="Year" DataField="Year" ItemStyle-HorizontalAlign="Center"
                                    SortExpression="Year" ItemStyle-VerticalAlign="Middle" />
  <asp:BoundField HeaderText="Category" DataField="Category" ItemStyle-HorizontalAlign="Center"
                                    SortExpression="Category" ItemStyle-VerticalAlign="Middle" />
 <asp:BoundField HeaderText="Sub Category" DataField="SubCategory" SortExpression="SubCategory" />
                            </Columns>
                            <HeaderStyle CssClass="header-link grid-Header DataGridFixedHeader gvHead " />
                            <RowStyle CssClass="gd_odd_txt gvRow" />

</asp:GridView>

在下面的图像格式中,我想获得 Duration 的总和

在此处输入图像描述

有任何想法吗?提前致谢

4

0 回答 0