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

Treat all cells as pure text

6 Answers 205 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
David M
Top achievements
Rank 1
David M asked on 24 May 2016, 09:36 PM

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?

6 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 May 2016, 03:40 PM
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!
 
0
David M
Top achievements
Rank 1
answered on 26 May 2016, 05:01 PM

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?

0
Stefan
Telerik team
answered on 27 May 2016, 11:19 AM
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!
 
0
David M
Top achievements
Rank 1
answered on 27 May 2016, 03:05 PM
Great, thank you Stefan.
0
underscore
Top achievements
Rank 1
answered on 27 Dec 2017, 07:15 PM
{formatOnly: true} seems to miss a reset of font size
0
Dimitar
Telerik team
answered on 29 Dec 2017, 02:46 PM
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.
Tags
Spreadsheet
Asked by
David M
Top achievements
Rank 1
Answers by
Stefan
Telerik team
David M
Top achievements
Rank 1
underscore
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or