This is a migrated thread and some comments may be shown as answers.

((GridBoundColumn) e.Column).Aggregate = GridAggregateFunction.Sum problem

1 Answer 129 Views
Grid
This is a migrated thread and some comments may be shown as answers.
arijit
Top achievements
Rank 1
arijit asked on 22 Nov 2012, 06:00 PM
I have a RadGrid (2012 Q1) with two levels and autogenerated columns.
In Column Created event I have
((GridBoundColumn) e.Column).Aggregate = GridAggregateFunction.Sum;

When I am expanding second level it is working for the first time, second time i am getting

Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.GridBoundColumn.ApplyAggregates35(TableCell cell, String footerText) +132
   Telerik.Web.UI.GridBoundColumn.cell_DataBinding(Object sender, EventArgs e) +492
   System.Web.UI.Control.OnDataBinding(EventArgs e) +99
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +517
   Telerik.Web.UI.GridTableView.CreateFooterItem(Boolean useDataSource, GridColumn[] copiedColumnSet, GridTFoot tfoot) +92
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1009
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +549
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   Telerik.Web.UI.GridTableView.PerformSelect() +16
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.GridTableView.DataBind() +233
   Telerik.Web.UI.GridDataItem.OnExpand() +289
   Telerik.Web.UI.GridItem.set_Expanded(Boolean value) +109
   Telerik.Web.UI.GridExpandCommandEventArgs.ExecuteCommand(Object source) +34
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +87
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Can anyone please help? or its a permanent bug ?

Regards
Arijit

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 27 Nov 2012, 03:46 PM
Hi Arijit,

This bug will be fixed for the future releases.

Sorry for any inconvenience caused.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
arijit
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or