Treat all cells as pure text

5 posts, 0 answers
  1. David M
    David M avatar
    13 posts
    Member since:
    Jul 2015

    Posted 24 May 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
    270 posts

    Posted 26 May 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. Kendo UI is VS 2017 Ready
  4. David M
    David M avatar
    13 posts
    Member since:
    Jul 2015

    Posted 26 May 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?

  5. Stefan
    Admin
    Stefan avatar
    270 posts

    Posted 27 May 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!
     
  6. David M
    David M avatar
    13 posts
    Member since:
    Jul 2015

    Posted 27 May Link to this post

    Great, thank you Stefan.
Back to Top
Kendo UI is VS 2017 Ready