VintaSoft Imaging .NET SDK 12.5: Documentation for Web developer
In This Topic
    XLSX: Work with cell columns on XLSX page
    In This Topic
    WebSpreadsheetEditorControlJS control allows to work (add, delete, copy, cut, paste, clear, resize, hide/show) with cell columns of XLSX worksheet in a web browser.

    Cell columns can be changed using mouse/keyboard or programmatically.


    Add the new cell column to XLSX worksheet

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

    Here is JavaScript code that demonstrates how to add a cell column to XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell column "D"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:D");
    
    // insert new cell column before column "D"
    spreadsheetEditorControl.insertColumns();
    


    Delete the cell column from XLSX worksheet

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

    Here is JavaScript code that demonstrates how to delete the cell column from XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell column "D"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:D");
    
    // delete the selected columns
    spreadsheetEditorControl.removeColumns();
    


    Copy and paste the cell column of XLSX worksheet

    If you want to copy and paste the cell column of XLSX worksheet using mouse, you should do the following steps:
    Here is JavaScript code that demonstrates how to copy and paste the cell column of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell column "D"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:D");
    
    // copy the selected cell column
    spreadsheetEditorControl.doCopy();
    
    // select the entire cell column "E"
    spreadsheetEditorControl.setFocusedAndSelectedCells("E:E");
    
    // copy the content of column "D" into column "E"
    spreadsheetEditorControl.doPaste(false);
    


    Cut and paste the cell column of XLSX worksheet

    If you want to cut and paste the cell column of XLSX worksheet using mouse, you should do the following steps:
    Here is JavaScript code that demonstrates how to cut and paste the cell column of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell column "D"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:D");
    
    // cut the selected cell column
    spreadsheetEditorControl.doCut();
    
    // select the entire cell column "E"
    spreadsheetEditorControl.setFocusedAndSelectedCells("G:G");
    
    // paste the content of column "D" into column "E"
    spreadsheetEditorControl.doPaste(false);
    


    Clear the content of cell column of XLSX worksheet

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

    Here is JavaScript code that demonstrates how to clear the content of cell column of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell column "D"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:D");
    
    // clear the content of selected column
    spreadsheetEditorControl.clearCellsContent();
    


    Auto fit the width of cell column of XLSX worksheet

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

    Here is JavaScript code that demonstrates how to auto fit the width of cell column of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell column "D"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:D");
    
    // autofit width of cell column
    spreadsheetEditorControl.autoFitColumnWidth();
    


    Hide/show the cell column of XLSX worksheet

    If you want to hide/show the cell column of XLSX worksheet using mouse, you should do the following steps:
    Here is JavaScript code that demonstrates how to hide and show the cell column of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // select the entire cell columns "D", "E", "F" and "G"
    spreadsheetEditorControl.setFocusedAndSelectedCells("D:G");
    
    // hide the selected cell columns
    spreadsheetEditorControl.hideColumns();
    
    // select the entire cell columns "E" and "F"
    spreadsheetEditorControl.setFocusedAndSelectedCells("E:F");
    
    // show the selected cell columns
    spreadsheetEditorControl.showColumns();