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

System.FormatException: Input string was not in a correct format error is thrown on Chrome when browser is zoomed in/out

5 Answers 759 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 08 Dec 2014, 04:46 PM
When Chrome browser is zoomed in/out System.FormatException: Input string was not in a correct format error is thrown. This is an issue introduced with the latest version of Chrome browser (39.0.2171.71) which started setting the scroll position as a floating point number rather than an integer. The affected Telerik controls are: RadScheduler, RadListBox, RadTreeView. This problem has been addressed in the Q3 2014 SP1 release, but if you are currently unable to upgrade use the code snippet solutions below:

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>

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>

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>

5 Answers, 1 is accepted

Sort by
0
Inian
Top achievements
Rank 1
answered on 27 Sep 2016, 05:02 PM
When I use this script block, ended up with "Uncaught ReferenceError: Telerik is not defined" in browser console.
0
Inian
Top achievements
Rank 1
answered on 27 Sep 2016, 05:29 PM
Its working. Just pasted the script in main content of aspx. 
0
Sailaja
Top achievements
Rank 1
answered on 22 Aug 2017, 05:33 PM

This logic for RadListBox is working for me too.. Pasted in aspx.. Thanks!

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) +
                    "}";

0
Peter
Top achievements
Rank 1
answered on 17 Oct 2017, 03:41 PM

Hi all,

I experienced just now the same problem with RadTreeList

is there also a workaround for RadTreeList?

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.

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.
Tags
General Discussions
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Answers by
Inian
Top achievements
Rank 1
Sailaja
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or