This is a migrated thread and some comments may be shown as answers.
System.FormatException:
23 Answers 213 Views
This is a migrated thread and some comments may be shown as answers.
Jagat
Top achievements
Rank 1
Jagat asked on 25 Nov 2014, 04:56 PM
We started getting this error message on all the pages that uses RadListBox. But only few clients are getting this issue. This is definitely not the data issue since all the users would be getting the error.

We are using  version 2011.3.1305.35 Telerik Ajax Controls.

System.Exception: 337.7143 is not a valid value for
Int32. ---> System.FormatException: Input string was not in a correct
format.

   at
System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

   at
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

   at
System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo
formatInfo)

   at
System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object value)

   --- End of inner
exception stack trace ---

   at
System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object value)

   at
System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)

   at
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object
o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
Object& convertedObject)

   at
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object
o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
Object& convertedObject)

   at
System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object
propertyValue, Object o, String memberName, JavaScriptSerializer serializer,
Boolean throwOnError)

   at
System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2
dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
Object& convertedObject)

   at
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object
o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
Object& convertedObject)

   at
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object
o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
Object& convertedObject)

   at
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer
serializer, String input, Type type, Int32 depthLimit)

   at
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String
input)

   at
Telerik.Web.UI.RadListBox.LoadPostData(String postDataKey, NameValueCollection
postCollection)

   at
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean
fBeforeLoad)

   at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)

   --- End of inner
exception stack trace ---

   at
System.Web.UI.Page.HandleError(Exception e)

   at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)

   at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)

   at System.Web.UI.Page.ProcessRequest()

   at
System.Web.UI.Page.ProcessRequest(HttpContext context)

   at
ASP.frm_clientservices_aspx.ProcessRequest(HttpContext context)

   at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

   at
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously).  

23 Answers, 1 is accepted

Sort by
0
Mehmet
Top achievements
Rank 1
answered on 25 Nov 2014, 09:04 PM
We have also started receiving the same error message for a couple clients. It's almost impossible to debug, because I can't reproduce the error myself. Most of them are Chrome users, and I think there might be some problem related to Chrome's recent updates, but I'm not sure. Any help will be greatly appreciated
0
Hristo Valyavicharski
Telerik team
answered on 26 Nov 2014, 01:29 PM
Hi,

We are aware of the problem and we are working on it. Here is the public item:
http://feedback.telerik.com/Project/108/Feedback/Details/144661-fix-treeview-throws-system-formatexception-input-string-was-not-in-a-correct-f

EDIT:

Same error can be thrown if you are using RadScheduler, RadListBox, RadTreeView.

Error appears only on Google Chrome when the page is zoomed in/out.
Temporary workaround: Change the Zoom to 100%.

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
rei
Top achievements
Rank 1
answered on 30 Nov 2014, 10:58 PM
Hi ,

We're also  encountering the same problem with some of our clients but it's hard to fix since I cannot replicate the problem myself.
Below is the exception in our logs.


Exception information:
    Exception type: Exception
    Exception message: 401.6 is not a valid value for Int32.
   at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)
   at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
   at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
   at System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object propertyValue, Object o, String memberName, JavaScriptSerializer serializer, Boolean throwOnError)
   at System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
   at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
   at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
   at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
   at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)
   at Telerik.Web.UI.RadListBox.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
   at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)






















0
Robert
Top achievements
Rank 1
answered on 01 Dec 2014, 08:38 AM
Same here!

Getting more reports of this now and doesn't seem to be ANYTHING I can do about it!

Can't reproduce it, can't debug it, can't workaround it. Zooming in/out doesn't make any difference.

Please can you post a workaround or at least explain (technically) what's going on here?


0
Robert
Top achievements
Rank 1
answered on 01 Dec 2014, 09:48 AM
Figured out what's going on by looking at the postback logs.

Chrome has started setting the scroll position as a floating point rather than an integer. RadListBox is not flooring this value before posting it back (or just parsing it as a double) which is causing a parsing exception on the server.

E.g. here's an example ClientState hidden field value after scrolling:

{"isEnabled":true,"logEntries":[{"Type":5,"Index":"12","Data":{"NewIndex":"17"}},{"Type":5,"Index":"18","Data":{"NewIndex":"9"}}],"selectedIndices":[],"checkedIndices":[12,18],"scrollPosition":36.6667}

That 36.6667 is the problem. I've worked around it by handling the RadListBox scroll event and flooring out the value before it's posted back:

$(".RadListBoxScrollable .rlbGroup").off("scroll.position-fix").on("scroll.position-fix", function () {

    $(this).scrollTop(Math.floor($(this).scrollTop()));
});

I should stress I'm not 100% if this will fix it yet, I'm awaiting user feedback as I can't reproduce it myself! But I'm pretty sure it will fix the problem as the issue is clearly that the RadListBox attempts to do an int.Parse() on a floating point on postback.
0
Hristo Valyavicharski
Telerik team
answered on 01 Dec 2014, 01:15 PM
Hi,

Here are the workarounds for:

RadScheduler:
<script type="text/javascript">
    Telerik.Web.UI.RadScheduler.prototype.saveClientState = function () {
        return '{"scrollTop":' + Math.round(this._scrollTop) + ',"scrollLeft":' + Math.round(this._scrollLeft) + ',"isDirty":' + this._isDirty + '}';
    }
</script>


RadTreeView:
<script type="text/javascript">
    Telerik.Web.UI.RadTreeView.prototype.saveClientState = function () {
        return "{\"expandedNodes\":" + this._expandedNodesJson +
        ",\"collapsedNodes\":" + this._collapsedNodesJson +
        ",\"logEntries\":" + this._logEntriesJson +
        ",\"selectedNodes\":" + this._selectedNodesJson +
        ",\"checkedNodes\":" + this._checkedNodesJson +
        ",\"scrollPosition\":" + Math.round(this._scrollPosition) + "}";
    }
</script>

RadListBox:
<script type="text/javascript">
        Telerik.Web.UI.RadListBox.prototype.saveClientState = function() {
            return "{" +
                        "\"isEnabled\":" + this._enabled +
                        ",\"logEntries\":" + this._logEntriesJson +
                       ",\"selectedIndices\":" + this._selectedIndicesJson +
                       ",\"checkedIndices\":" + this._checkedIndicesJson +
                       ",\"scrollPosition\":" + Math.round(this._scrollPosition) +
                   "}";
        }
</script>      

The fix for the issue will be included in the upcoming Service Pack.

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rachel
Top achievements
Rank 1
answered on 04 Dec 2014, 10:33 AM
Are you able to provide a javascript workaround for the RadDropDownList as well? Many thanks.
0
Hristo Valyavicharski
Telerik team
answered on 05 Dec 2014, 09:37 AM
Hi Rachel,

This problem shouldn't exist in the RadDropDownList? If you receive error message please open new thread here: http://www.telerik.com/forums/aspnet-ajax/dropdownlist and describe the problem in details.

Thanks.

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rachel
Top achievements
Rank 1
answered on 05 Dec 2014, 10:09 AM
I'm not having a problem with it, but in your post dated 26 Nov you said:

'Same error can be thrown if you are using RadScheduler, RadListBox, RadDropDownList, RadTreeView.'

So I was going from that.
0
Hristo Valyavicharski
Telerik team
answered on 08 Dec 2014, 03:07 PM
Sorry Rachel,

This was a mistake. I edited my post. Fix for the other issues will be included in Q3 2014 SP1. It is expected to be released till the end of week.

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
SHERFUDEEN
Top achievements
Rank 1
answered on 09 Dec 2014, 08:28 AM
Hi Hristo Valyavicharski,
I am also getting the same issue. I added the Javascript in the Masterpage of my application. But I am getting the error "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

I changed the code as

$(Telerik.Web.UI.RadListBox).prototype.saveClientState =funtion(){
// code
}
Now I am getting
" Uncaught TypeError: Cannot set property 'saveClientState' of undefined (anonymous function)" Error
How can I solve this?
0
Mark
Top achievements
Rank 2
answered on 09 Dec 2014, 07:29 PM
Is there an ETA on the release of Q3 2014 SP1?  Is the fix available in the nightly build?
0
Hristo Valyavicharski
Telerik team
answered on 10 Dec 2014, 11:16 AM
Q3 SP1 2014.3.1209 was released yesterday. You can download it from our website.

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
SHERFUDEEN
Top achievements
Rank 1
answered on 10 Dec 2014, 01:50 PM
Hi Hristo Valyavicharski,

Is there any solution for my below issue without updating the Telerik Q3. I am using 2014.1.225.40 version


" I added the Javascript in the Masterpage of my application. But I am getting the error "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

I changed the code as

$(Telerik.Web.UI.RadListBox).prototype.saveClientState =funtion(){
// code
}
Now I am getting
" Uncaught TypeError: Cannot set property 'saveClientState' of undefined (anonymous function)" Error
How can I solve this? "

"
0
SHERFUDEEN
Top achievements
Rank 1
answered on 10 Dec 2014, 01:52 PM
Hi Hristo Valyavicharski,

Is there any solution for my below issue without updating Telerik Q3. I am using 2014.1.225.40 Version

" I added the Javascript in the Masterpage of my application. But I am getting the error "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

I changed the code as

$(Telerik.Web.UI.RadListBox).prototype.saveClientState =funtion(){
// code
}
Now I am getting
" Uncaught TypeError: Cannot set property 'saveClientState' of undefined (anonymous function)" Error
How can I solve this? "

0
John
Top achievements
Rank 1
answered on 12 Dec 2014, 04:00 PM
I am experiencing the same issue, "Uncaught TypeError: Cannot read property 'prototype' of undefined" when trying to apply the fix for Treeview. Is there a fix for this?
0
John
Top achievements
Rank 1
answered on 12 Dec 2014, 04:26 PM
Hristo, I am experiencing the same issue as Sherfudeen when applying the fix for Treeview  "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

What can I do the resolve this?
0
Rachel
Top achievements
Rank 1
answered on 12 Dec 2014, 04:32 PM
When putting the fix in the master page, what worked for me was to wrap each fix like this:

if (Telerik.Web.UI.RadTreeView != undefined) {
            [RadTreeView fix goes here]
        }

When including the fix in the master page, there might not be an instance of that control on a particular page, so it will throw an error on that page unless you add this condition to the fix. At least I think that's what the problem is anyway :)

Hope that helps!
0
Jagat
Top achievements
Rank 1
answered on 12 Dec 2014, 04:36 PM
Hristo,
With this update Q3 SP1 2014.3.1209, i am having issues on radgrid. 
System.InvalidCastException: Conversion from string
"&nbsp;" to type 'Integer' is not valid. --->
System.FormatException: One of the identified items was in an invalid format.

Another error we found:
System.InvalidOperationException: Telerik.Web.UI.RadGrid
with ID='RadGrid1' was unable to find an embedded skin with the name 'Hay'.
Please, make sure that the skin name is spelled correctly and that you have
added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If
you want to use a custom skin, set EnableEmbeddedSkins=false.

Nothing else was changed in code. 
Just, update the dll's and we get these errors.






0
SHERFUDEEN
Top achievements
Rank 1
answered on 15 Dec 2014, 10:21 AM
Thanks for the solution Rachel, it works.
0
John
Top achievements
Rank 1
answered on 15 Dec 2014, 03:51 PM
@Rachel, thanks this solved my issue.
0
Peter
Top achievements
Rank 1
answered on 17 Oct 2017, 03:34 PM

Hi All,

although this problem should be fixed since 2014,

I experienced it just now with a RadTreeList Control.

Is it really fixed also for RadTreeList? 

What is the workaround for RadTreeLis?

Regards Peter

 

 

0
Rumen
Telerik team
answered on 20 Oct 2017, 08:08 AM
Hi Peter,

We are not aware of this problem and I was unable to reproduce it in the live demo of RadTreeList: https://www.screencast.com/t/WQkCGipFE.

Are you able to replicate the issue in the live demo: http://demos.telerik.com/aspnet-ajax/treelist/examples/overview/defaultcs.aspx?

If not, can you please test your app with the latest version of the AJAX components: 2017.3.913?
If the problem still persists, please isolate it in and send a simple working project along with step-by-step instructions of how to reproduce it locally.

Kind Regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Jagat
Top achievements
Rank 1
Answers by
Mehmet
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
rei
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Rachel
Top achievements
Rank 1
SHERFUDEEN
Top achievements
Rank 1
Mark
Top achievements
Rank 2
John
Top achievements
Rank 1
Jagat
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or