Everything works fine, but as soon as I try to use Aggregate and FooterAggregateFormatString, it comes up with a target invocation exception on my databind line. Am I supposed to do it a different way?
My aspx file has:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" UpdateInitiatorPanelsOnly="true"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="myRadGrid"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="myRadGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"> </telerik:RadAjaxLoadingPanel> <telerik:RadGrid ClientSettings-Scrolling-ScrollHeight="500" ShowFooter="true" ClientSettings-Scrolling-AllowScroll="true" ClientSettings-Scrolling-UseStaticHeaders="true" RenderMode="Lightweight" OnSortCommand="SortCommand" AllowSorting="true" ID="myRadGrid" runat="server" EnableEmbeddedSkins="False"> <ItemStyle BackColor="#E2E4FF" Font-Size="10" /> <AlternatingItemStyle Font-Size="10" /> <HeaderStyle CssClass="CustomHeader" BorderStyle="Solid" BorderWidth="1" BorderColor="Black" HorizontalAlign="Center" Font-Size="12" /> <MasterTableView AutoGenerateColumns="false" TableLayout="Fixed"> <Columns> <telerik:GridTemplateColumn SortExpression="load_seconds" Aggregate="Sum" FooterAggregateFormatString="Total Seconds: {0}" HeaderButtonType="TextButton" HeaderStyle-Width="14%" HeaderText="Load Seconds"> <ItemTemplate> <%#String.Format("{0}", Eval("load_seconds")) %> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> <EditFormSettings> <EditColumn CancelImageUrl="Cancel.gif" InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif"> </EditColumn> </EditFormSettings> </MasterTableView> <HeaderStyle CssClass="CustomHeader"></HeaderStyle> <FilterMenu RenderMode="Lightweight"></FilterMenu> <HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu> </telerik:RadGrid>and my aspx.vb files has:
Protected Sub loadData() lbl_errormsg.Text = "" Dim bEffDt As Date Dim eEffDt As Date Dim begEffDt As String = "" Dim endEffDt As String = "" bEffDt = Beg_Date.SelectedDate eEffDt = End_Date.SelectedDate begEffDt = bEffDt.ToString("yyyy/MM/dd") endEffDt = eEffDt.ToString("yyyy/MM/dd") Try myRadGrid.DataSource = FastSQL.SelectQuery("myDB", "my select statement") Catch ex As Exception lbl_errormsg.Text = "There was an error." End Try myRadGrid.DataBind() End Subwith Page_load calling loadData()
