I am tring to add a custom aggregate to a group footer. I need to step throught all the data in the grid for that group. I just can't seem to find the values.
Please tell me how to change this.
Thanks,
Please tell me how to change this.
Thanks,
Protected Sub dgrPartnerTransactions_CustomAggregate(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCustomAggregateEventArgs) Handles dgrPartnerTransactions.CustomAggregate |
Dim items As GridItem() = Me.dgrPartnerTransactions.MasterTableView.GetItems(GridItemType.Item) |
Dim Amount As Int32 = 0 |
For Each index As GridDataItem In items |
Amount = Amount + CType(index.GetDataKeyValue("TransactionAmount"), Int32) |
Next |
e.Result = Amount.ToString() |
End Sub |
<telerik:RadGrid PageSize="100" ID="dgrPartnerTransactions" ShowGroupPanel="true" |
runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" |
Skin="Office2007" GridLines="None" Width="99%" ShowFooter="true"> |
<PagerStyle Mode="NextPrevNumericAndAdvanced" /> |
<MasterTableView TableLayout="Fixed" ShowGroupFooter="true"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridTemplateColumn HeaderText="" UniqueName="DeleteThis" Groupable="false"> |
<HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle> |
<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle> |
<ItemTemplate> |
<asp:CheckBox ID="DeleteThis" runat="server" /> |
<asp:Label runat="server" Visible="False" ID="lblPartnerTransactionID" Text='<%#DataBinder.Eval(Container, "DataItem.PartnerTransactionID")%>'></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn" Groupable="false"> |
<HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle> |
<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle> |
<ItemTemplate> |
<asp:HyperLink ID="hypEditLink" runat="server" Text="Edit" NavigateUrl="#" OnClick='<%# getEditWindowURL( DataBinder.Eval(Container, "DataItem.PartnerTransactionID") ) %>'></asp:HyperLink> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Transaction Type" UniqueName="PartnerTransactionType" |
Groupable="false" DataField="PartnerTransactionType" SortExpression="PartnerTransactionType" |
GroupByExpression="PartnerTransactionType Group By PartnerTransactionType"> |
<HeaderStyle HorizontalAlign="Left"></HeaderStyle> |
<ItemStyle HorizontalAlign="Left"></ItemStyle> |
<ItemTemplate> |
<%#DataBinder.Eval(Container, "DataItem.PartnerTransactionType")%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Date" UniqueName="TransactionDate" Groupable="false" |
DataField="TransactionDate" SortExpression="TransactionDate" GroupByExpression="TransactionDate Group By TransactionAmount"> |
<HeaderStyle HorizontalAlign="Center"></HeaderStyle> |
<ItemStyle HorizontalAlign="Center"></ItemStyle> |
<ItemTemplate> |
<%#DataBinder.Eval(Container, "DataItem.TransactionDate", "{0:d}")%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Amount" UniqueName="TransactionAmount" Groupable="false" |
DataField="TransactionAmount" SortExpression="TransactionAmount" Aggregate="Custom"> |
<HeaderStyle HorizontalAlign="Center"></HeaderStyle> |
<ItemStyle HorizontalAlign="Center"></ItemStyle> |
<ItemTemplate> |
<%#DataBinder.Eval(Container, "DataItem.TransactionAmount", "{0:C}")%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Check Number" UniqueName="CheckNumber" Groupable="false" |
DataField="CheckNumber" SortExpression="CheckNumber" GroupByExpression="CheckNumber Group By CheckNumber"> |
<HeaderStyle HorizontalAlign="Left"></HeaderStyle> |
<ItemStyle HorizontalAlign="Left"></ItemStyle> |
<ItemTemplate> |
<%#DataBinder.Eval(Container, "DataItem.CheckNumber")%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Paid Out of Escrow?" UniqueName="PaidOutOfEscrow" |
Groupable="false" DataField="PaidOutOfEscrow" SortExpression="PaidOutOfEscrow" |
GroupByExpression="PaidOutOfEscrow Group By PaidOutOfEscrow"> |
<HeaderStyle HorizontalAlign="Left"></HeaderStyle> |
<ItemStyle HorizontalAlign="Left"></ItemStyle> |
<ItemTemplate> |
<%#FormatYesNo(DataBinder.Eval(Container, "DataItem.PaidOutOfEscrow"))%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Property" UniqueName="PropertyAddress" DataField="PropertyAddress" |
SortExpression="PropertyAddress" GroupByExpression="PropertyAddress Group By PropertyAddress"> |
<HeaderStyle HorizontalAlign="Left"></HeaderStyle> |
<ItemStyle HorizontalAlign="Left"></ItemStyle> |
<ItemTemplate> |
<a href='PropertyDetails.aspx?PropertyID=<%#DataBinder.Eval(Container, "DataItem.PropertyID")%>' |
target="_blank"> |
<%#DataBinder.Eval(Container, "DataItem.PropertyAddress")%></a> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Transaction Note" UniqueName="TransactionNote" |
Groupable="false" DataField="TransactionNote" SortExpression="TransactionNote" |
GroupByExpression="TransactionNote Group By TransactionNote"> |
<HeaderStyle HorizontalAlign="Left"></HeaderStyle> |
<ItemStyle HorizontalAlign="Left"></ItemStyle> |
<ItemTemplate> |
<%#DataBinder.Eval(Container, "DataItem.TransactionNote")%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Document" UniqueName="PropertyID" Groupable="false"> |
<ItemTemplate> |
<%#getDocumentURL(DataBinder.Eval(Container, "DataItem.DocumentName"), DataBinder.Eval(Container, "DataItem.DocumentLocation"))%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Balance" UniqueName="Balance" Groupable="false" |
DataField="Balance" SortExpression="Balance" |
GroupByExpression="Balance Group By Balance"> |
<HeaderStyle HorizontalAlign="Center"></HeaderStyle> |
<ItemStyle HorizontalAlign="Right"></ItemStyle> |
<ItemTemplate> |
<%#DataBinder.Eval(Container, "DataItem.Balance", "{0:C}")%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
<GroupByExpressions> |
<telerik:GridGroupByExpression> |
<GroupByFields> |
<telerik:GridGroupByField FieldName="PropertyID" /> |
</GroupByFields> |
<SelectFields> |
<telerik:GridGroupByField FieldName="TransactionAmount" HeaderText="TransactionAmount" /> |
</SelectFields> |
</telerik:GridGroupByExpression> |
</GroupByExpressions> |
</MasterTableView> |
<ClientSettings AllowDragToGroup="false" AllowGroupExpandCollapse="true" AllowColumnsReorder="true"> |
<Scrolling AllowScroll="False" UseStaticHeaders="True" SaveScrollPosition="true" |
FrozenColumnsCount="1"></Scrolling> |
</ClientSettings> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
</FilterMenu> |
</telerik:RadGrid> |