Remove validation of a range of cells

4 posts, 0 answers
  1. David M
    David M avatar
    14 posts
    Member since:
    Jul 2015

    Posted 21 Apr 2016 Link to this post

    I'm looking through your docs, and I can't seem to find an easy way to remove the validation on a range of cells.

    I've tried passing an empty object to range.validation without success.  Any ideas?

  2. David M
    David M avatar
    14 posts
    Member since:
    Jul 2015

    Posted 21 Apr 2016 Link to this post

    Figured it out.  Pass null into the validation method and it wipes it all out.  This spreadsheet tool is fantastic!

  3. Prasadh
    Prasadh avatar
    4 posts
    Member since:
    Dec 2014

    Posted 09 Oct 2018 in reply to David M Link to this post

    Hi Can you please explain little more? It will be helpful if you post code snippet. My doubt is how to clear all the validations in the sheet before export to excel?
  4. David M
    David M avatar
    14 posts
    Member since:
    Jul 2015

    Posted 11 Oct 2018 Link to this post

    Hi Prasadh,

    I did something like this:

    var range = $("#spreadsheet").data("kendoSpreadsheet").activeSheet().range("A1:A100");  //Get the range of cells I want to remove validation from.

    range.validation(null);  //Null out the validation

    The only problem with this method, is that you need to re-create the spreadsheet widget after making a change like this.  (it may be fixed in a more recent build)

    var storedSheet=$("#spreadsheet").data("kendoSpreadsheet").toJSON(); //Keep the sheet in JSON format for rebuilding later.

    $("#spreadsheet").data("kendoSpreadsheet").destroy(); // destroy the Grid
    $("#spreadsheet").remove(); // remove all Grid HTML - might be unnecessary

    Then use the json spreadsheet data that you stored in storedSheet to rebuild your spreadsheet widget.

    I don't know if this is still the most effective way to do this, but that's what I'm using.

     

     

     

     

Back to Top