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

Spreadsheet with Remote Datasource, Apply Validation/Formulas to Entire Column Except First Row

1 Answer 108 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nish
Top achievements
Rank 1
Nish asked on 18 Jun 2020, 09:31 AM

I'm trying to add validation/formulas to an entire column except the first row. I found this thread to select an entire column:

https://www.telerik.com/forums/column-validation-20a85bc435da

 

The problem with the above method is that my spreadsheet is bound to a remote data source, so the first row is column headers. Is there a way to apply formulas and validation to all of the other rows except the first? Defining these cell-by-cell causes a big delay when the data is loaded.

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 22 Jun 2020, 07:52 AM

Hello Nish,

With the method described in the thread, the validation will be applied to the specified range. In case you need to set validation to all cells except the first row, using the validation method of the Range object will be the recommended approach. You could set a range that contains all cells except those for the header and configure the needed validation rules. Below is an example in Vue.

new Vue({
  el: "#vueapp",
  mounted() {
    var spreadsheet = this.$refs.spreadsheet.kendoWidget();
    var sheet = spreadsheet.activeSheet();    
    sheet.range("C2:D20").validation({      
      to: "10",
      from: "5",
      allowNulls: false,
      comparerType: "between",
      dataType: "number",
      type: "reject",
      messageTemplate: "Number should match the validation"
    })
  },

A similar example for setting validation rules to column ranges is linked below:

- https://docs.telerik.com/kendo-ui/controls/data-management/spreadsheet/how-to/validation-to-column

I hope you will find the provided information helpful. In case you have follow up questions please let me know.

Regards,
Neli
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Nish
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or