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

Re-set spreadsheet options

5 Answers 205 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Anna
Top achievements
Rank 1
Anna asked on 05 Sep 2017, 04:38 PM

Hi team,

How do I change a spreadsheet's options after it's initialized? E.g. I want to change columns width every time I change data fetch. I tried: 

$("#spreadsheet").data("kendoSpreadsheet").setOptions(newOption);

This doesn't seems to work at all.

Best,

 

Anna

5 Answers, 1 is accepted

Sort by
0
Anna
Top achievements
Rank 1
answered on 05 Sep 2017, 08:17 PM

I found option to change column width: sheet.columnWidth(index, width);

However, I'm still interested in changing other options. Like cell formatings.

Also, wondering if there's ability to set a whole row's or column's format in the options? I know there's ability to set format using range, I can set each cell's format.

0
Veselin Tsvetanov
Telerik team
answered on 07 Sep 2017, 10:03 AM
Hi Anna,

Using the setOptions() for altering the formatting of the Spreadsheet rows / cols / cells would not be possible. As you correctly noticed, the Sheet and Range objects methods instead should be used.

Cell formatting (including for entire row / column) can be performed using the Range object methods. The Kendo API does not expose any additional methods that would allow entire row / column formatting.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anna
Top achievements
Rank 1
answered on 07 Sep 2017, 06:17 PM

Hi Veselin, 

Thank you for replying. In terms of performance, which will be more costly?

1. destroy previous spreadsheet, and re-initialize with new options

2. make numerous( > 5)  range selections to set new styles?

Best,

 

Annna

0
Veselin Tsvetanov
Telerik team
answered on 08 Sep 2017, 02:33 PM
Hi Anna,

When manipulating the Spreadsheet using the Range object, you could use the Sheet.batch() â€‹method which would allow you to suppresses triggering of change events for a sequence of actions. Triggers a single change event at the end of the sequence. In such case, playing with the Range objects should be a more appropriate option.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anna
Top achievements
Rank 1
answered on 22 Sep 2017, 08:54 PM
For anyone else with similar problem. I found better solution, use sheet.fromJson(sheetOptions);.
Tags
Spreadsheet
Asked by
Anna
Top achievements
Rank 1
Answers by
Anna
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or