Spreadsheet validation problem

7 posts, 1 answers
  1. David
    David avatar
    3 posts
    Member since:
    Jan 2012

    Posted 25 Mar Link to this post

    I try to add Data Validation to a range with List as validation type.

    - first row is disabled to show column titles

    - my validation range is B2:B50

    Data validation for the first cell (B2) is working, but oher cells in B column does not work.

    Can you help me ?

    The code:

    <div id="spreadsheet" style="width: 100%;"></div>

    $(function () {
        var spreadsheet = $("#spreadsheet").kendoSpreadsheet({
            toolbar: false,
            //sheetsbar: false,
            sheets: [
                {
                    rows: [
                        {
                            cells: [
                                { value: "Fonds" },
                                { value: "Sens" },
                                { value: "Code" },
                                { value: "Quantité" },
                                { value: "Cours" }
                            ]
                        }
                    ]
                },
                {
                    name: "ListAchatVente",
                    rows: [
                        {
                            cells: [
                                {
                                    value: "A"
                                },
                                {
                                    value: "V"
                                }
                            ]
                        }
                    ]
                }
            ]
        }).data("kendoSpreadsheet");
     
        var range = spreadsheet.activeSheet().range("1:1");
        range.enable(false);
     
        var columnSens = spreadsheet.activeSheet().range("B2:B30");
        columnSens.validation({
            dataType: "list",
            from: "ListAchatVente!A1:B1",
            allowNulls: true,
            type: "reject",
            titleTemplate: "Valeur invalide",
            messageTemplate: "Valeur autorisée: 'A' ou 'V'."
        });
    });

     

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 30 Mar Link to this post

    Hi,

    Please accept my apologies for the delayed response.

    The validation seems to be working in my tests. Can you please check if you're using the latest version?

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. David
    David avatar
    3 posts
    Member since:
    Jan 2012

    Posted 30 Mar in reply to T. Tsonev Link to this post

    hi,

    I must not understand the validation system, because when I add a V in B2, it works, but if I add a V in B3, validation displays the incorrect validation message.

    Screenshot attached

     

  5. David
    David avatar
    3 posts
    Member since:
    Jan 2012

    Posted 30 Mar in reply to T. Tsonev Link to this post

    hi,
    I must not understand the validation system, because when I add a V in B2, it works, but if I add a V in B3, validation displays the incorrect validation message.
    Screenshot attached

    regards,

    David

  6. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 01 Apr Link to this post

    Hi,

    My mistake here. I'm not sure how I tested this exactly the last time around, but it's definitely not working as expected.

    That said, we found the issue. The from range is not locked to the row and expands with the validated range. Fixing it is simple:
        from: "ListAchatVente!$A$1:$B$1"

    I'll check if we can enhance the docs to make this clear.
    Apologies for the caused inconvenience.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. David M
    David M avatar
    13 posts
    Member since:
    Jul 2015

    Posted 21 Apr Link to this post

    Thanks for posting this question, I was wondering the same thing yesterday and got my code working.

     

     Although I'm having another issue.  After I apply the "list" validation on a range of cells the flags appear properly at first.  Once I click anywhere on the page, flags appear improperly on ALL of my cells. Once I make a change anywhere on the spreadsheet the flags appear properly again.  

    Did either of you see this issue?

  8. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 26 Apr Link to this post

    Hello David,

    I tried reproducing this issue, but without success.
    Can you take my sample and update it to illustrate the problem? Thanks!

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready