Error with popup open and without annotation

2 posts, 0 answers
  1. Xavier
    Xavier avatar
    28 posts
    Member since:
    Dec 2010

    Posted 02 Mar Link to this post


    It’s posible not close grid popup if I have added in modelstate an error on créate or update method of controller.

    public ActionResult DirectInCreate([DataSourceRequest]DataSourceRequest request, DirectInViewModel service)
                if (ModelState.IsValid)
                    if (service.OrigenID == 0)
                        string errorMessage = string.Format("El camp Productor es obligatori.");
                        ModelState.AddModelError("", errorMessage);

    function onError(e, gridName) {
            if (e.errors) {
                var message = "Errors:\n";
                $.each(e.errors, function (key, value) {
                    if ('errors' in value) {
                        $.each(value.errors, function () {
                            message += this + "\n";
                var grid = $("#" + gridName).data("kendoGrid");
      "dataBinding", function (e) {



    Thanks in advance.



    Xavier de la Rubia.

  2. Radoslav
    Radoslav avatar
    1564 posts

    Posted 04 Mar Link to this post

    Hello Xavier,

    The code snippet which you post should prevent the popup for closing. You can check out the following code library which shows the same functionality:
    Also I am sending you a simple example based on this code library which shows the desired functionality.

    I hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top