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

[Solved] Grid Throws Error Instead of Displaying NoRecordsTemplate

3 Answers 208 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel Kraft
Top achievements
Rank 2
Joel Kraft asked on 06 May 2008, 10:02 PM
I am using the 2008.1 version of radGrid, and am having a problem with one set of data that I am trying to display.  The grid is bound to a dataset obtained from a stored procedure.  The stored procedure contains a simple select statement, that, on occasion, will not return any data.

In this new version, instead of seeing the NoRecordsTemplate, the page crashes with stack dump below.  I have other pages with the same setup that seem to work fine.  This page also works as long as the SP doesn't return an empty recordset.  (For clarification, the SP does indeed return an empty recordset.  It doesn't try to return nothing.).

Thanks,
Joel


[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.GridBoundColumn.PrepareFieldName(IEnumerable enumerable, IQueryable queryable, String fieldName, Type dataType) +35
Telerik.Web.UI.GridBoundColumn.GetAggregate(IEnumerable enumerable, IQueryable queryable, String fieldName, Type dataType, GridAggregateFunction func) +26
Telerik.Web.UI.GridBoundColumn.ApplyAggregates35(TableCell cell, String footerText) +323
Telerik.Web.UI.GridBoundColumn.cell_DataBinding(Object sender, EventArgs e) +491
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +206
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +204
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
System.Web.UI.Control.DataBind() +12
Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +539
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +726
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +471
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
Telerik.Web.UI.GridTableView.PerformSelect() +4
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
Telerik.Web.UI.GridTableView.DataBind() +304
Telerik.Web.UI.RadGrid.DataBind() +77
Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +132
Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +120
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

3 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 07 May 2008, 07:19 AM
Hello Joel,

This looks like the problem we unfortunately introduced with the aggregates in ASP.NET 3.5 version of the Grid with an empty DataSource. It will be fixed shortly and the bug fix will be included in the next official update.

You can turn the linq expressions off for the time being. Please, set Grid's EnableLinqExpressions to false and let us know if further assistance is needed.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Joel Kraft
Top achievements
Rank 2
answered on 07 May 2008, 11:27 PM
Well....changing EnableLinqExpressions to false definitely changes something.  Now the grid ALWAYS throws an error!  :-)

[SyntaxErrorException: Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier.]
System.Data.ExpressionParser.ParseAggregateArgument(FunctionId aggregate) +457
System.Data.ExpressionParser.Parse() +1260
System.Data.DataExpression..ctor(DataTable table, String expression, Type type) +124
System.Data.DataTable.Compute(String expression, String filter) +106
Telerik.Web.UI.GridBoundColumn.ApplyAggregates(TableCell cell, String footerText) +942
Telerik.Web.UI.GridBoundColumn.cell_DataBinding(Object sender, EventArgs e) +512
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +206
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +204
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
System.Web.UI.Control.DataBind() +12
Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +539
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +726
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +471
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
Telerik.Web.UI.GridTableView.PerformSelect() +4
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
Telerik.Web.UI.GridTableView.DataBind() +304
Telerik.Web.UI.RadGrid.DataBind() +77
Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +132
Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +120
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

0
Vlad
Telerik team
answered on 08 May 2008, 07:17 AM
Hello Joel,

Please send us small example demonstrating this via support ticket. I will review your scenario and I will get back to you on how to resolve this.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Joel Kraft
Top achievements
Rank 2
Answers by
Konstantin Petkov
Telerik team
Joel Kraft
Top achievements
Rank 2
Vlad
Telerik team
Share this question
or