Kendo Spredsheet

0 Answers 19 Views
Spreadsheet
brajesh
Top achievements
Rank 1
Iron
brajesh asked on 30 May 2022, 10:44 AM

Hello,

 

1. How to put validation in spreadsheet when  i'm getting data dynamically their are data coming key value pair.So how to validate every column based on requirement.Please help me to solve this problem. Thanks

Martin
Telerik team
commented on 02 Jun 2022, 09:05 AM

You can use the Range validation method to dynamically set validation for a range. Let me know if that would be helpful.
brajesh
Top achievements
Rank 1
Iron
commented on 02 Jun 2022, 09:25 AM

Yes Thank you range validation working good but i have another issue related to that for numerical type data it's not validating max length

I have apply like this

 sheet.range("AM2:AM30").validation({
        dataType: "custom",
        from: "AND(ISNUMBER(AM2),LEN(AM2)<20)",
        allowNulls: true,
        type: "reject",
        titleTemplate: "2022 validation error",
        messageTemplate: "Please enter numeric value with less than 20 digits."
    });

do i need to change the code ?

Martin
Telerik team
commented on 07 Jun 2022, 09:26 AM

The LEN formula only applies for text, I am afraid it will not apply for digits. A possible approach would be to check if the value is greater than a specific number:

sheet.range("A2:A30").validation({
  dataType: "custom",
  from: "AND(ISNUMBER(A2),A2<=2000000)",
  to:999,
  allowNulls: true,
  type: "reject",
  titleTemplate: "2022 validation error",
  messageTemplate: "Please enter numeric value with less than 20 digits."
});

brajesh
Top achievements
Rank 1
Iron
commented on 16 Jun 2022, 06:26 AM

Thank you Martin It's working good.

No answers yet. Maybe you can help?

Tags
Spreadsheet
Asked by
brajesh
Top achievements
Rank 1
Iron
Share this question
or