VintaSoft Imaging .NET SDK 15.1: Documentation for Web developer
In This Topic
XLSX: Work with cell rows on XLSX page
In This Topic
WebSpreadsheetEditorControlJS control allows to work (add, delete, copy, cut, paste, clear, resize, hide/show) with cell rows of XLSX worksheet in a web browser.
Cell rows can be changed using mouse/keyboard or programmatically.


Add the new cell row to an XLSX worksheet

If you want to add the new cell row to an XLSX worksheet using mouse, you should do the following steps:

Here is JavaScript code that demonstrates how to add the cell row to an XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell row "2"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:2");

// insert new cell row before row "2"
spreadsheetEditorControl.insertRows();


Delete cell row of XLSX worksheet

If you want to delete the cell row of XLSX worksheet using mouse, you should do the following steps:

Here is JavaScript code that demonstrates how to delete the cell row of XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell row "2"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:2");

// delete the selected rows
spreadsheetEditorControl.removeRows();


Copy and paste the cell row of XLSX worksheet

If you want to copy and paste the cell row of XLSX worksheet using mouse, you should do the following steps:
Here is JavaScript code that demonstrates how to copy and paste the cell row of XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell row "2"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:2");

// copy the selected cell row
spreadsheetEditorControl.doCopy();

// select the entire cell row "4"
spreadsheetEditorControl.setFocusedAndSelectedCells("4:4");

// copy the content of row "2" into row "4"
spreadsheetEditorControl.doPaste(false);


Cut and paste the cell row of XLSX worksheet

If you want to cut and paste the cell row of XLSX worksheet using mouse, you should do the following steps:
Here is JavaScript code that demonstrates how to cut and paste the cell row of XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell row "2"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:2");

// cut the selected cell row
spreadsheetEditorControl.doCut();

// select the entire cell row "4"
spreadsheetEditorControl.setFocusedAndSelectedCells("4:4");

// paste the content of row "2" into row "4"
spreadsheetEditorControl.doPaste(false);


Clear the content of cell row of XLSX worksheet

If you want to clear the content of the cell row of XLSX worksheet using mouse, you should do the following steps:

Here is JavaScript code that demonstrates how to clear the content of cell row of XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell row "2"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:2");

// clear the content of selected row
spreadsheetEditorControl.clearCellsContent();


Auto fit the height of cell row of XLSX worksheet

If you want to auto fit the height of cell row of XLSX worksheet using mouse, you should do the following steps:

Here is JavaScript code that demonstrates how to auto fit the height of cell row of XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell row "2"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:2");

// autofit height of cell row
spreadsheetEditorControl.autoFitRowHeight();


Hide/show the cell row of XLSX worksheet

If you want to hide/show the cell row of XLSX worksheet using mouse, you should do the following steps:
Here is JavaScript code that demonstrates how to hide and show the cell row of XLSX worksheet:
// _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class

// get spreadsheet editor
var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();

// select the entire cell rows "2", "3", "4", "5" and "6"
spreadsheetEditorControl.setFocusedAndSelectedCells("2:6");

// hide the selected cell rows
spreadsheetEditorControl.hideRows();

// select the entire cell rows "3" and "4"
spreadsheetEditorControl.setFocusedAndSelectedCells("3:4");

// show the selected cell rows
spreadsheetEditorControl.showRows();