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

RadGrid & .NET Framework 3.5 Service Pack 1

2 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John Ngo
Top achievements
Rank 1
John Ngo asked on 26 Sep 2008, 04:24 PM
After upgrade to .NET Framework 3.5 Service Pack 1, few pages in my site don't work:

1) on one page use
 <telerik:GridBoundColumn HeaderText="Hours" DataField="THours" UniqueName="THours" DataType="System.Decimal" Aggregate="Sum" AllowFiltering="False" AllowSorting="False" FooterText="Total: "></telerik:GridBoundColumn> 
         

I got error:
 
[InvalidCastException: Specified cast is not valid.] 
   lambda_method(ExecutionScope , DataRow ) +321 
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +190 
   System.Linq.Enumerable.Sum(IEnumerable`1 source) +95 
   lambda_method(ExecutionScope ) +127 
   System.Linq.EnumerableExecutor`1.Execute() +108 
   System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +68 
   System.Linq.Queryable.Sum(IQueryable`1 source) +163 
   Telerik.Web.UI.GridBoundColumn.GetAggregateByType(IQueryable queryable, String fieldName, GridAggregateFunction func) +240 
changed it to Aggregate="Count", it runs fine

2) This line of code:
Dim fieldValue As Single = Single.Parse(dataItem("TotalInvoice").Text)
works fine before upgrade. Now it throws error:
[FormatException: Input string was not in a correct format.] 
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7467367 
   System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt) +115 
   System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info) +192 
   System.Single.Parse(String s) +23 
   mbreq_AllReqs.rgRequisitions_ItemDataBound(Object sender, GridItemEventArgs e) in D:\Websites\_MB_Intranet_v3\mbreq\AllReqs.aspx.vb:101 
   Telerik.Web.UI.RadGrid.OnItemDataBound(GridItemEventArgs e) +78 
   Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +628 
   Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode) +135 
   Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +398 
   Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +129 
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +574 
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +454 
   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() +4 
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 
   Telerik.Web.UI.GridTableView.DataBind() +235 
   Telerik.Web.UI.RadGrid.DataBind() +80 
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72 
   System.Web.UI.Control.EnsureChildControls() +87 
   System.Web.UI.Control.PreRenderRecursiveInternal() +44 
   System.Web.UI.Control.PreRenderRecursiveInternal() +171 
   System.Web.UI.Control.PreRenderRecursiveInternal() +171 
   System.Web.UI.Control.PreRenderRecursiveInternal() +171 
   System.Web.UI.Control.PreRenderRecursiveInternal() +171 
   System.Web.UI.Control.PreRenderRecursiveInternal() +171 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 
 



I upgraded the server and they didn't run. I tested in my local box and they run fine. Upgraded my local computer and they just don't run after the upgrade.

Please help.


2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 29 Sep 2008, 12:17 PM
Hello John,

In order to solve the fist problem, try setting the EnableLinqExpressions property of RadGrid to false.

As it is to the second error you face:
Please try debugging your application and check what is the value you are trying to parse and if it could be really parsed to Single.

Let us know how it goes.

Greetings,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
John Ngo
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
John Ngo
Top achievements
Rank 1
Share this question
or