How to set row height for multiple rows ?

How to set row height for multiple rows ? Any spreadsheet api


11 Replies

SP Sangeetha Priya Murugan Syncfusion Team July 28, 2022 11:18 AM UTC

Hi gofeatureus,


Your requirement can be achievable in our spreadsheet by iterating the row index and set the height by using setRowHeight method as like as below.


Code Block:


  

function updateCollection() {

  let range = spreadsheet.getActiveSheet().selectedRange; // to get the selected range

  let index = getRangeIndexes(range); // to get the index

  // for rows iteration

  for (let i = index[0]; i <= index[2]; i++) spreadsheet.setRowHeight(40, i, 0);

}

 


For your convenience, we have prepared the sample based on our suggestion. In this we have updated the height for multiple rows in a button click event. Please find the link below.


Sample Link:  https://stackblitz.com/edit/qnw5gc?file=index.ts,index.html


API Link: https://ej2.syncfusion.com/documentation/api/spreadsheet/#setrowheight


To set the height globally for all rows, please refer the below link.


https://www.syncfusion.com/kb/13185/how-to-apply-cell-formats-and-number-formats-globally-in-spreadsheet


Could you please check the above links and get back to us, if you need any further assistance on this.


Regards,

Sangeetha M



GO gofeatureus July 29, 2022 05:50 AM UTC

thanks sang


i'm not use for condition . need direct api, i pass range in args (height(A1:A1000))



SP Sangeetha Priya Murugan Syncfusion Team July 29, 2022 12:06 PM UTC

Hi gofeatureus,


Currently we don’t have this option to provide the range like “A1:A1000” in our setRowHeight method. however, we will also do the same in our source level to update the height for multiple rows. So, we have created the custom method to update the height based on your need as like as below.


Code Block:


  

 

 created: (): void => {

    customRowHeight(40, 'A1:A1000', 0);

  },

});

 

 

function customRowHeight(height, range, sheetIdx) {

  let index = getRangeIndexes(range); // to get the index

  // for rows iteration

  for (let i = index[0]; i <= index[2]; i++)

    spreadsheet.setRowHeight(height, i, sheetIdx);

  spreadsheet.resize();

}

 


For your convenience we have prepared the sample based on our suggestion. Please find the link below.


Sample Link: https://stackblitz.com/edit/qnw5gc-pn47fb?file=index.ts,index.html


Or else if you need to change the height of all rows in your sheet, you can achieve this in queryCellInfo event itself. For more details, please refer the below link.


https://www.syncfusion.com/kb/13185/how-to-apply-cell-formats-and-number-formats-globally-in-spreadsheet


Sample Link: https://stackblitz.com/edit/lbgncs


Could you please check the above links and get back to us, if you need any further assistance on this.


Regards,

Sangeetha M



GO gofeatureus August 3, 2022 06:24 AM UTC

Any feadback?



SP Sangeetha Priya Murugan Syncfusion Team August 4, 2022 12:03 PM UTC

Hi gofeatureus,


Currently, we don’t have any plan to include this in our source level. So, only we have suggested to use our last provided workaround solution to achieve your requirement in our end. Please get back to us, if you need any further assistance on this.


Regards,

Sangeetha M



GO gofeatureus August 5, 2022 05:42 AM UTC

??????



SP Sangeetha Priya Murugan Syncfusion Team August 8, 2022 02:19 PM UTC

Hi gofeatureus,


We considered this as improvement and the fix will be available in any of our Essential studio Volume 3 release. Which is scheduled to be rolled out on end of September 2022.we appreciate your patience until then. You can track the status of this improvement using below link from our feedback portal. 


Feedback Portal Link: https://www.syncfusion.com/feedback/36902/provide-option-to-set-height-for-multiple-rows-using-api


Regards,

Sangeetha M



SP Sangeetha Priya Murugan Syncfusion Team October 5, 2022 12:10 PM UTC

Hi gofeatureus,


As we have some other high priority customer promised improvements and bugs, we have planned to provide this fix in Volume 3 SP release. Which is scheduled to be rolled out in first week of November 2022. Until then, we suggest you to use our previously provided workaround solution to achieve your requirement. If we complete the fix prior, we will inform you until then we appreciate your patience until then.


Regards,

Sangeetha M



SP Sangeetha Priya Murugan Syncfusion Team November 9, 2022 01:23 PM UTC

We are glad to announce that our Essential Studio 2022 Volume 3 SP release v20.3.0.56 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/178709/essential-studio-2022-volume-3-service-pack-release-v20-3-0-56-is-available-for-download


Feedback Link: https://www.syncfusion.com/feedback/36902/provide-option-to-set-height-for-multiple-rows-using-api


Release notes link: https://ej2.syncfusion.com/documentation/release-notes/20.3.56/?type=all#spreadsheet


Sample Link: https://stackblitz.com/edit/kb6edr?file=index.ts


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.



WI will January 9, 2023 09:27 AM UTC

To change the row height of multiple rows, select the rows that you want to change, and then drag the boundary below one of the selected row headings. To change the row height for all rows on the worksheet, click the Select All button, and then drag the boundary below any row heading


Regards,

Will



SP Sangeetha Priya Murugan Syncfusion Team January 10, 2023 12:38 PM UTC

Hi Will,

 

Currently, we don’t have this support (Resize multiple columns/rows at the UI level), so if you select multiple columns/rows and drag the boundary, the last column will only be resized based on our behavior. Therefore, we suggest using the setRowsHeight and setColumnsWidth methods to meet your needs.



https://ej2.syncfusion.com/documentation/api/spreadsheet/#setrowsheight


https://ej2.syncfusion.com/documentation/api/spreadsheet/#setcolumnswidth


Loader.
Up arrow icon