Treat all cells as pure text

7 posts, 0 answers
  1. David M
    David M avatar
    14 posts
    Member since:
    Jul 2015

    Posted 24 May 2016 Link to this post

    Is there a way to remove all automatic formatting on cells, specifically the date/time auto formatting?

    If this isn't a reasonable request, is there a way to retrieve the "text value" of the cell?  I can see that the values are stored as numbers with a format attached, how does one pull out the text of the cell that's being displayed?

  2. Stefan
    Admin
    Stefan avatar
    2887 posts

    Posted 26 May 2016 Link to this post

    Hello David,

    If you want to clear the automatic formatting on cells, check the clear method of the Kendo UI SpreadSheet, and use it with the key value formatOnly: true as an object.

    http://docs.telerik.com/kendo-ui/api/javascript/spreadsheet/range#methods-clear

    If you want to retrieve the value of the cell, please check the following:

    - the activeSheet method of the Kendo UI SpreadSheet to get the active sheet:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet#methods-activeSheet

    - the range method of the Kendo UI SpreadSheet to retrieve the Range for the given range specification

    http://docs.telerik.com/kendo-ui/api/javascript/spreadsheet/sheet#methods-range

    - value and values methods of the range method to get the value of the cell/s.

    http://docs.telerik.com/kendo-ui/api/javascript/spreadsheet/range#methods-value
    http://docs.telerik.com/kendo-ui/api/javascript/spreadsheet/range#methods-values

    Let me know if you need additional assistance.

    Regards,
    Stefan
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. David M
    David M avatar
    14 posts
    Member since:
    Jul 2015

    Posted 26 May 2016 Link to this post

    Hi Stefan,

    Thanks for the help, unfortunately the clear({formatOnly:true}) only clears the formatting that already is present, and doesn't stop the formatting behavior on a cell.  

    If I enter "6/5/15" into a cell, tab out, the text value is displayed as 6/5/2016 and if I clear that format, I'm left with a numeric value of 42536.  If I then enter "6/5/15" back into that cell and tab out, the formatting takes place again and I'm left with 6/5/2016 thus continuing my formatting loop.

    Is there way to stop this automatic formatting?

  4. Stefan
    Admin
    Stefan avatar
    2887 posts

    Posted 27 May 2016 Link to this post

    Hello David,

    As for now we are working on the solution for your request. We have opened a discussion with our developers to fix it. You can find more information and closely monitor the progress of the request at:

    https://github.com/telerik/kendo-ui-core/issues/1723 

    If you have additional question, I will gladly assist. 

    Regards,
    Stefan
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. David M
    David M avatar
    14 posts
    Member since:
    Jul 2015

    Posted 27 May 2016 Link to this post

    Great, thank you Stefan.
  6. underscore
    underscore avatar
    21 posts
    Member since:
    Dec 2011

    Posted 27 Dec 2017 in reply to Stefan Link to this post

    {formatOnly: true} seems to miss a reset of font size
  7. Dimitar
    Admin
    Dimitar avatar
    473 posts

    Posted 29 Dec 2017 Link to this post

    Hello,

    Thank you for reporting this issue. I logged it for fixing.

    Regards,
    Dimitar
    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