Indexed Validation For Cell Range

4 posts, 0 answers
  1. Michael
    Michael avatar
    4 posts
    Member since:
    Oct 2016

    Posted 07 Apr 2017 Link to this post

    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"
    });

     

     

     

  2. Nencho
    Admin
    Nencho avatar
    1874 posts

    Posted 10 Apr 2017 Link to this post

    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 visualization (charts) and form elements.
  3. Jothi
    Jothi avatar
    1 posts
    Member since:
    Dec 2018

    Posted 27 Mar 2019 in reply to Michael Link to this post

    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.

  4. Nencho
    Admin
    Nencho avatar
    1874 posts

    Posted 29 Mar 2019 Link to this post

    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.
Back to Top