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

Indexed Validation For Cell Range

3 Answers 42 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 07 Apr 2017, 02:19 PM

In all of the demos in the docs, cells that need to use validation functions like IsNumber, Len, etc. are done on a cell-by-cell manor like this:

{
    dataType: "custom",
    from: "AND(ISNUMBER(G2),LEN(G2)<6)",
    type: "warning",
    allowNulls: true,
    titleTemplate: "Invalid Item",
    messageTemplate: "Value must be a number and 5 characters or less"
}

 

Is there any way to do this type of thing for a range of cells? I'm looking for something similar to this by replacing "CurrentCell" with something:

var range = spreadsheet.activeSheet().range("G2:G100");
range.validation({
    dataType: "custom",
    from: "AND(ISNUMBER(CurrentCell),LEN(CurrentCell)<6)",
    type: "warning",
    allowNulls: true,
    titleTemplate: "Invalid Item",
    messageTemplate: "Value must be a number and 5 characters or less"
});

 

 

 

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 10 Apr 2017, 01:51 PM
Hello,

I would suggest logging your feature request in our public portal:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback


Regards,
Nencho
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Jothi
Top achievements
Rank 1
answered on 27 Mar 2019, 03:25 PM

This could be achieved using R1C1 notation. Function refering R[0]C[0] takes the value from current cell. Number inside [] indicates up or down position cell from current cell. 0 - current cell.

For reference

https://bettersolutions.com/excel/formulas/cell-references-a1-r1c1-notation.htm

 

{
    dataType: "custom",
    from: "AND(ISNUMBER(R[0]C[0]),LEN(R[0]C[0])<6)",
    type: "warning",
    allowNulls: true,
    titleTemplate: "Invalid Item",
    messageTemplate: "Value must be a number and 5 characters or less"
}

 

Hope this helps.

0
Nencho
Telerik team
answered on 29 Mar 2019, 11:06 AM
Hey Jothi,

Thanks for sharing your suggestion with the community. Indeed the approach that you've referenced seems like a good approach for the case.

I have updated your Telerik Points for the dedication to the community and the willingness to help. Thank you!

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Spreadsheet
Asked by
Michael
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Jothi
Top achievements
Rank 1
Share this question
or