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

6 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1696 posts
    Member since:
    Oct 2004

    Posted 08 Dec 2014 Link to this post

    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>

  2. Inian
    Inian avatar
    3 posts
    Member since:
    Mar 2016

    Posted 27 Sep 2016 in reply to Telerik Admin Link to this post

    When I use this script block, ended up with "Uncaught ReferenceError: Telerik is not defined" in browser console.
  3. Inian
    Inian avatar
    3 posts
    Member since:
    Mar 2016

    Posted 27 Sep 2016 in reply to Inian Link to this post

    Its working. Just pasted the script in main content of aspx. 
  4. Sailaja
    Sailaja avatar
    2 posts
    Member since:
    Jul 2012

    Posted 22 Aug Link to this post

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

  5. Peter
    Peter avatar
    5 posts
    Member since:
    Jun 2015

    Posted 17 Oct Link to this post

    Hi all,

    I experienced just now the same problem with RadTreeList

    is there also a workaround for RadTreeList?

    Regards, Peter

     

  6. Rumen
    Admin
    Rumen avatar
    13241 posts

    Posted 20 Oct Link to this post

    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.
Back to Top