Telerik Forums
UI for ASP.NET MVC Forum
1 answer
129 views
Hello everybody

I have a grid with a detailtemplate. This detailtemplate contains also a grid.
My parent grid refers to an Edition-Model which contains many Articles. When the user expands an Edition-Row, the detailgrid contains all correct Articles.

The problem now is, that i want to check, if one Article is allready read by the user. So i want to insert a conclusion, that i can show one or another value in a column of the detailgrid.

On this website, i found the template-syntax: http://docs.kendoui.com/getting-started/framework/templates/overview#template-syntax

But it doesnt work fine. In the detailgrid the conclusion checks every time the parent-data (Edition) and not the detaildata (Article).

My ClientTemplate (for the detail grid)
columns.Bound(c => c.IsRead).ClientTemplate("" +
                "#if(IsRead== true) {#" +
                "Read"+
                "#} else{#" +
                "Not Read +
                "#}#")
                .Title("State").Width(120);

When i put an output in the ClientTemplate as shown in the link above, then the Template renders the correct data (with the \\# syntax)

Example (clienttemplate for the detail grid):
columns.Bound(c => c.IsRead).ClientTemplate("" +
                "#if(IsRead== true) {#" +
                "#=data.Id#"+      // Shows parent Id
                "#} else{#" +
                "\\#=data.Id\\# +     // Shows the correct id from the detail row
                "#}#")
                .Title("State").Width(120);
My question now: How can I check the data of the detailrow in a conclusion??

Edit:
For better understanding: I have the sam CSharp - Model in both Grids. When i make two diffrent models, then it is the same situation. Only one diffrence: Javascript-Console says: Undifined Property (for IsRead). Because my actual Edition - Model has no property named IsRerad.

Thanks and have a nice day
MJ
Daniel
Telerik team
 answered on 09 Sep 2013
2 answers
472 views
I am currently trying out kendo.ui for asp.net mvc

I have a model

public class RegionViewModel 
{
  public int Id { get; set; }
  public string Name { get; set; }
   public IList<VillageViewModel> Villages {get; set; }
}

public class VillageViewModel
{
 public int Id {get; set; }
   public string Name {get; set; }
}

Basically its a many to many relationship .. the model is built using entity framework.
But that is not really the problem.

I am trying to select multiple Villages from a huge list and assign them to a region. The region is the main row entity for a grid.
I am using the MultiSelect widget in an editor template.

This works fine, selection works and everything. But on clicking update no ajax request is sent to the server ( i am using inline edit mode ) 
I have tried everything, looked at the sample provided here: http://www.kendoui.com/code-library/mvc/grid/using-multiselect-in-grid.aspx

But i cannot get this to work apparently.
One requirement that i have btw is that the multiselect has to be using ajax as well since for exampel there are 17.000 possible villages in our database right now
and loading them all on creating the editor takes to long, and also makes the editor basically unusable.

Here is my field and column setup code:

 fields.Field(Accessor).DefaultValue(new List<VillageViewModel>());
columns.Bound(t => t.Villages).EditorTemplateName("MultiReference");

My editor template: ( not using the html helper ,since that does not allow for using serverpaging right now )

select id="Villages">
</select>

<script>

    jQuery(function() {
        jQuery("#Villages").kendoMultiSelect(
            {
                "dataSource":
                {
                    "transport":
                    {
                        "prefix": "",
                        "read":
                        {
                            "url": "/admin/regions/villages",
                            "data": function() {
                                return kendo.ui.MultiSelect.requestData("#Villages");
                            }
                        }
                    },
                    "serverFiltering": true,
                    "serverPaging": true,
                    "pageSize": 20,
                    "filter": [],
                    "schema": {
                        "errors": "Errors"
                    }
                },
                "dataTextField": "Name",
                "dataValueField": "Id",
                "value": []
            });
    });
</script>

And here is the final grid script that gets rendered:

jQuery(function () {
    jQuery("#regionsGrid").kendoGrid({
        "columns": [{
            "title": "Name",
            "field": "Name",
            "filterable": {},
            "encoded": true,
            "editor": "\u003cinput class=\"k-textbox\" id=\"Name\" name=\"Name\" type=\"text\" value=\"\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Name\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"
        }, {
            "title": "Villages",
            "template": "#for(var i = 0; i\u003c data.length; i  ){#\u003cspan\u003e#:data[i].Name#\u003c/span\u003e#}#",
            "field": "Villages",
            "filterable": {},
            "encoded": true,
            "editor": "\r\n\r\n\u003cselect id=\"Villages\"\u003e\r\n\u003c/select\u003e\r\n\r\n\u003cscript\u003e\r\n\r\n    jQuery(function() {\r\n        jQuery(\"#Villages\").kendoMultiSelect(\r\n            {\r\n                \"dataSource\":\r\n                {\r\n                    \"transport\":\r\n                    {\r\n                        \"prefix\": \"\",\r\n                        \"read\":\r\n                        {\r\n                            \"url\": \"/Admin/regions/Villages\",\r\n                            \"data\": function() {\r\n                                return kendo.ui.MultiSelect.requestData(\"#Villages\");\r\n                            }\r\n                        }\r\n                    },\r\n                    \"serverFiltering\": true,\r\n                    \"serverPaging\": true,\r\n                    \"pageSize\": 20,\r\n                    \"filter\": [],\r\n                    \"schema\": {\r\n                        \"errors\": \"Errors\"\r\n                    }\r\n                },\r\n                \"dataTextField\": \"Name\",\r\n                \"dataValueField\": \"Id\",\r\n                \"value\": []\r\n            });\r\n    });\r\n\u003c/script\u003e\r\n\r\n\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Villages\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"
        }, {
            "title": "Commands",
            "width": "200px",
            "command": [{
                "name": "edit",
                "buttonType": "ImageAndText",
                "text": "Edit"
            }, {
                "name": "destroy",
                "buttonType": "ImageAndText",
                "text": "Delete"
            }]
        }],
        "pageable": {
            "buttonCount": 10
        },
        "sortable": true,
        "scrollable": false,
        "editable": {
            "confirmation": "Are you sure you want to delete this record?",
            "mode": "inline",
            "create": true,
            "update": true,
            "destroy": true
        },
        "toolbar": {
            "command": [{
                "name": null,
                "buttonType": "ImageAndText",
                "text": "Add new record"
            }]
        },
        "dataSource": {
            "transport": {
                "prefix": "",
                "read": {
                    "url": "/Admin/regions/List"
                },
                "update": {
                    "url": "/Admin/regions/Update",
                    "data": gridSerialize
                },
                "create": {
                    "url": "/Admin/regions/Create",
                    "data": gridSerialize
                },
                "destroy": {
                    "url": "/Admin/regions/Destroy"
                }
            },
            "pageSize": 10,
            "page": 1,
            "total": 0,
            "serverPaging": true,
            "serverSorting": true,
            "serverFiltering": true,
            "serverGrouping": true,
            "serverAggregates": true,
            "type": "aspnetmvc-ajax",
            "filter": [],
            "schema": {
                "data": "Data",
                "total": "Total",
                "errors": "Errors",
                "model": {
                    "id": "Id",
                    "fields": {
                        "Villages": {
                            "type": "object",
                            "defaultValue": []
                        },
                        "Id": {
                            "editable": false,
                            "type": "number"
                        },
                        "Name": {
                            "type": "string"
                        },
                        "Slug": {
                            "type": "string"
                        }
                    }
                }
            },
            "autoSync": true
        }
    });
});

Or are there any other recommended options to edit many to many relationships in a grid ? 









Bernhard
Top achievements
Rank 1
 answered on 06 Sep 2013
1 answer
802 views
I'm trying to learn both Kendo and MVC at the same time, so bear with me.  In the code below, I know I could populate my grid via Ajax and frankly I'd be more comfortable with that, but I'm trying to acquaint myself with the basics, so I'd like to avoid it for now.

I would like the contents of my Grid to be restricted by both a DropDownList and a Search box.  The issue is that when you turn on Pageable for a Kendo Grid, it wants to GET the next page.  But since my DropDownList and my Search box will not be part of the GET params, they won't be available to the Action.  So the question:

Is it hopelessly naive to use Grid without Ajax or is there a straightforward way to either include my additional parameters or make the pagination use the form POST?

@using (Html.BeginForm(null, null, FormMethod.Post, new { id="searchForm" })) {
   <script>
      function submit() { $("#searchForm").submit() }
   </script>
   @(Html.Kendo().DropDownListFor(m => m.ListID).DataValueField("ID").DataTextField("Name")
         .BindTo(Model.Lists).Events(e => e.Change("submit")))
   @Html.Kendo().AutoCompleteFor(m => m.SearchText).Placeholder("Search")
   <input type="submit" value="Search" />
   @Html.Kendo().Grid(Model.Albums).Name("AlbumsGrid").BindTo(Model.Albums).Pageable().Sortable()
}
Petur Subev
Telerik team
 answered on 06 Sep 2013
1 answer
210 views
We do not want to highlight the group header on collapse expand. Basically it should not have k-state-focused and k-state-highlight applied to it when I expand or collapse. 

Can you please advise a trick?
Iliana Dyankova
Telerik team
 answered on 06 Sep 2013
0 answers
134 views
On our current project we have implemented server-side grouping, however, I can find no documentation on how to manually populate the aggregated totals of the groupings into the DataSourceResult object that the Kendo Grid expects from the server.  Newing up a List<AggregateResult> doesn't seem to work as many of the properties of the AggregateResult object are read only.  We can't use the ToDataSourceResult() extension method because we're also paging on the server, so we're only pulling back subsets of the total dataset at whatever page size the user has selected.

Is there some documentation somewhere that I'm just not seeing?  If so, can you point it out to me, and if not, what guidance can you offer in populating those aggregated totals?
David
Top achievements
Rank 1
 asked on 06 Sep 2013
3 answers
386 views
Hi,
I'm using the ASP.NET MVC wrapper for the scheduler. The problem is that when I want to edit an event I just created (for example lengthen the event in the week view) the scheduler calls the Create-Method and not the Update-Method. I could imagine it has something to do with the ID of the newly created event.
How can I correct this?

The Create-Method:
public JsonResult Scheduler_Create([DataSourceRequest] DataSourceRequest request, SchedulerModel model)
        {
            Calendar_Entry entry = new Calendar_Entry
            {
                ID=Guid.NewGuid(),
                Description=model.Description,
                End=model.End,
                Begin=model.Start,
                CreationTime=DateTime.UtcNow,
                UpdateTime=DateTime.UtcNow,
                Name=model.Title,
                Calendar_ID=model.CalendarID
            };
            dbContext.Add(entry);
            dbContext.SaveChanges();
            model.ID = entry.ID;
            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }
The Scheduler:
@(Html.Kendo().Scheduler<ViCRM.Models.SchedulerModel>()
                    .Name("scheduler")
                    .Date(DateTime.UtcNow)
                    .StartTime(new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, 6, 0, 0))
                    .Height(750)
                    .Views(views =>
                    {
                        views.DayView();
                        views.WeekView(weekView => weekView.Selected(true));
                        views.MonthView();
                        views.AgendaView();
                    })
                    .Timezone("Etc/UTC")
                    .DataSource(d => d
                        .Model(m =>
                        {
                            m.Id(f => f.ID);
                        })
                        .Read("Scheduler_Read", "Calendar")
                        .Create("Scheduler_Create", "Calendar")
                        .Destroy("Scheduler_Delete", "Calendar")
                        .Update("Scheduler_Update", "Calendar")
                    )
                    .EventTemplateId("EventTemplate")
                    .Resources(res =>
                    {
                        res.Add(m => m.CalendarID).Title("Kalender").DataSource(ds => ds.Read("getCalendars", "Calendar")).DataValueField("Value").DataTextField("Text").DataColorField("Color");
                )
Kendo UI Version is 2013.2.716

Thanks in advance.
Atanas Korchev
Telerik team
 answered on 06 Sep 2013
1 answer
432 views
Hello,

I am trying to create a simple grid where I allow incell editing and each time a cell edits it sends that row back to the server with an ajax call, but I can't seem to get inline editing to work.  here is what I have so far...

01.@using Kendo.Mvc.UI
02.@model IEnumerable<Forms.Models.Pending>
03. 
04. 
05.@{
06.    Layout = "~/Views/Shared/_Layout.cshtml";  
07.}
08. 
09.<h2>Pending</h2>
10. 
11.@(Html.Kendo().Grid(Model)
12.    .Name("Grid")
13.    .Columns(columns =>
14.        {
15.            columns.Bound(p => p.Name).Groupable(false);
16.            columns.Bound(p => p.Number);
18.            columns.Bound(p => p.Status);
21.            columns.Bound(p => p.Analyst);
22.        })
23.        .Editable(editable => editable.Mode(GridEditMode.InCell))
24.        .Pageable()
25.        .Sortable()
26.        .DataSource(dataSource => dataSource
27.            .Ajax()
28.            .Model(model => model.Id(p => p.Id))
29.            .Read("Index", "Home")
30.            .Update("Row_Edit", "Home")
31.        )
32.)
I am trying to use the .Update property to call the Row_Edit method in my home controller to handle each edit.  Any ideas?
Dimiter Madjarov
Telerik team
 answered on 06 Sep 2013
3 answers
322 views
Hi,

I'm experiencing a somewhat annoying problem when scrolling my views;

Quite regularly when I scroll, the view "locks up" and the entire view scrolls and shows the grey browser background. By this I mean the footer, the header and the view content. I've attached two images.

Here's my _Layout.cshtml:
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="@Url.Content("~/Content/kendo/2013.2.716/kendo.common.min.css")" rel="stylesheet"/>
    <link href="@Url.Content("~/Content/kendo/2013.2.716/kendo.default.min.css")" rel="stylesheet"/>
    <link href="@Url.Content("~/Content/kendo/2013.2.716/kendo.mobile.flat.min.css")" rel="stylesheet"/>
     
    @*<script src="~/Scripts/jquery-1.8.2.min.js"></script>*@
    <script src="@Url.Content("~/Scripts/kendo/2013.2.716/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2013.2.716/kendo.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2013.2.716/kendo.aspnetmvc.min.js")"></script>
</head>
<body>
    @(Html.Kendo().MobileLayout()
              .Name("frontlayout")
              .Header(obj =>
                      Html.Kendo().MobileNavBar()
                          .Content(navbar =>
                                   @<text>
                                        @navbar.ViewTitle("")
                                    </text>)
              )
              .Footer(obj =>
                      Html.Kendo().MobileTabStrip()
                          .Items(items =>
                              {
                                  items.Add().Icon("action").Text("Logout").Url("index", "logout");
                              })
              )
              )
 
    @(Html.Kendo().MobileLayout()
              .Name("layout")
              .Header(obj =>
                      Html.Kendo().MobileNavBar()
                          .Content(navbar =>
                                   @<text>
                                            @(Html.Kendo().MobileBackButton()
                                                        .Align(MobileButtonAlign.Left)
                                                        .HtmlAttributes(new { @class = "nav-button" })
                                                        .Url(Url.RouteUrl(new { controller = "home" }))
                                                        .Text("Back"))
                                        @navbar.ViewTitle("")
                                    </text>)
              )
              .Footer(obj =>
                      Html.Kendo().MobileTabStrip()
                          .Items(items =>
                              {
                                  items.Add().Icon("action").Text("Logout").Url("index", "logout");
                              })
              )
          )
     
    @(Html.Kendo().MobileApplication()
              .ServerNavigation(false)
              .Transition("fade")
              .HideAddressBar(true)
              .Skin("flat")
              )
    @RenderBody()
</body>
</html>
 
<!-- Style for custom status icon in list -->
<style>
    .statusicon {
        float: right;
        margin-right: 50px;
        margin-top: 5px;
        display: inline-block;
        border-width: 1px;
        border-radius: 35px;
        border-style: solid;
        border-color: black;
        width: 15px;
        height: 1em;
    }
 
    .sl-hidden {
        display: none;
        visibility: hidden;
    }
</style>
And here's my view:
@model Stimline.Xplorer.Mobile.Models.UnitDetailsModel
@Scripts.Render("~/Scripts/jquery.signalR-1.1.2.js")
@Scripts.Render("~/signalr/hubs")
 
@Scripts.Render("~/Scripts/Stimline/connector.js")
 
@(Html.Kendo().MobileView()
        .Name("unit-list")
        .Layout("layout")
        .Title("Units")
        .Content(
            @<text>
                 <span class="sl-hidden" id="signalRconveyanceId">@Model.ViewUnitContract.ConveyanceId</span>
                 @ListViewHelper(this)
             </text>
           )
        )
 
@helper ListViewHelper(WebViewPage page)
{
    @(Html.Kendo().MobileListView().Name("unitlist").Style("inset").Type("group")
                    .Items(root =>
                        {
                            root.Add().Text("Unit Details").Items(items =>
                                {
                                    items.Add().Content(@<text>
                                                                     <label>
                                                                         Unit
                                                                         <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.Name" />
                                                                     </label>
                                                                 <li style="background-color: #@Model.StatusColor">
                                                                     <label>
                                                                         Status
                                                                         <input type="text"disabled="disabled" value="@Model.StatusMessage" style="color: ghostwhite;"/>
                                                                     </label>
                                                                 </li>
                                                         </text>);
                                });
                                 
                                root.Add().Text("Detail information").Items(items =>
                                {
                                    items.Add().Content(@<text>
                                                             <label>
                                                                       Depth (m)
                                                                       <input id ="signalRdepth" type="text" disabled="disabled" style="color: black" value="@Math.Round((decimal) Model.ViewUnitContract.CurrentRun.LatestWellLogEntry.Depth, 2)" />
                                                                   </label>
                                                             <li data-icon="recents">
                                                                 <label>
                                                                     Speed (m/min)
                                                                     <input id ="signalRspeed" type="text" disabled="disabled" style="color: black"  value="@Math.Round((decimal) Model.ViewUnitContract.CurrentRun.LatestWellLogEntry.Speed, 2)"/>
                                                                 </label>
                                                             </li>
                                                             <li data-icon="recents">
                                                                 <label>
                                                                     Diff Speed (m/min)
                                                                     <input id ="signalRdiffSpeed" type="text" disabled="disabled" style="color: black" value="@Math.Round((decimal) Model.ViewUnitContract.CurrentRun.LatestWellLogEntry.DiffSpeed, 2)"/> <!-- DiffSpeed -->
                                                                 </label>
                                                             </li>
                                                             <li data-icon="recents">
                                                                 <label>
                                                                     Weight (kg)
                                                                     <input id ="signalRtension" type="text" disabled="disabled" style="color: black" value="@Math.Round((decimal) Model.ViewUnitContract.CurrentRun.LatestWellLogEntry.Tension, 2)"/>
                                                                 </label>
                                                             </li>
                                                             <li data-icon="recents">
                                                                 <label>
                                                                     Diff Weight (kg)
                                                                     <input id ="signalRdiffTension" type="text" disabled="disabled" style="color: black" value="@Math.Round((decimal) Model.ViewUnitContract.CurrentRun.LatestWellLogEntry.DiffTension, 2)"/> <!-- DiffTension -->
                                                                 </label>
                                                             </li>
                                                         </text>);
                                });
                                 
                                root.Add().Text("Run Overview").Items(items =>
                                    {
                                        items.Add().Content(@<text>
                                                                 <label>
                                                                           Name
                                                                           <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.Name" />
                                                                       </label>
                                                                 <li data-icon="recents">
                                                                     <label>
                                                                         Start time
                                                                         <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.StartTime"/>
                                                                     </label>
                                                                 </li>
                                                                 <li data-icon="recents">
                                                                     <label>
                                                                         End time
                                                                         <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.EndTime"/>
                                                                     </label>
                                                                 </li>
                                                             </text>);
                                    });
                                     
                                    root.Add().Text("Project").Items(items =>
                                        {
                                            items.Add().Content(@<text>
                                                                     <label>
                                                                               Operation
                                                                               <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.Operation.Description"/>
                                                                           </label>
                                                                     <li>
                                                                         <label>
                                                                             Name
                                                                             <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.Operation.ProjectContract.Name"/>
                                                                         </label>
                                                                     </li>
                                                                 </text>);
                                    });
                                     
                                    root.Add().Text("Well").Items(items =>
                                        {
                                            items.Add().Content(@<text>
                                                                     <label>
                                                                               Name
                                                                               <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.Operation.WellContract.Name"/>
                                                                           </label>
                                                                     <li>
                                                                         <label>
                                                                             Location
                                                                             <input type="text" disabled="disabled" style="color: black" value="@Model.ViewUnitContract.CurrentRun.Operation.WellContract.Location"/>
                                                                         </label>
                                                                     </li>
                                                                 </text>);
                                    });
                        })
            )
}
Any idea what might be causing this?

Also, the "Back" button seems to be unstable. Sometimes it works, and sometimes nothing happens when I click it.
Kiril Nikolov
Telerik team
 answered on 06 Sep 2013
1 answer
155 views
I have a basic MVC Kendo Grid using am Action as a DataSource with Ajax enabled.  I'd like to make the row clickable (no command buttons) to then open a hidden value which is a row specific MVC URL into a Jquery modal window.  My fundamental goal is to have a grid holding X number of rows, each row with a potentially custom URL used for editing data.  Can someone point me in the right direction?  thanks.
Daniel
Telerik team
 answered on 05 Sep 2013
2 answers
342 views
Hi,

I have a view with 4 kendo grids  (Version 2013.1.514 MVC complete) doing different functions for the user and I have a central mechanism to handle all errors from all the grids of the application.

Grid Configuration
@(Html.Kendo().Grid<NewAlta.DataCapture.DataModel.ParameterOverride>()
                   .Name("test")
                   .Columns(columns =>
                       {
                           columns.Bound(p => p.CustomerId).Hidden();
                           columns.ForeignKey(p => p.EquipmentId, (System.Collections.IEnumerable)ViewData["equipments"], "EquipmentId", "Description").Title("Equipment").EditorTemplateName("CustomerEquipmentId");
                           columns.ForeignKey(p => p.ParameterId, (System.Collections.IEnumerable)ViewData["parameters"], "ParameterId", "ParameterName").Title("Parameter").EditorTemplateName("ParameterId");
                           columns.Bound(p => p.Limit1).Width(100);
                           columns.Bound(p => p.Limit2).Width(200);
                           columns.Bound(p => p.Limit3).Width(200);
                           columns.Bound(p => p.Limit4).Width(100);
                           columns.Command(p => p.Edit()).Width(80);
                       })
                   .ToolBar(toolbar => toolbar.Create())
                   .Editable(editable => editable.Mode(GridEditMode.InLine))
                   .AutoBind(false)
                  // .Navigatable(builder => builder.Enabled(true))
                   .Events(events =>
                       {
                           events.Change("test");
                           events.Edit("test");
                           events.Save("test");
                       })
                   .Selectable(builder => builder.Mode(GridSelectionMode.Single))                  
                   .DataSource(dataSource => dataSource
                                                 .Ajax()
                                                 .ServerOperation(false)
                                                 .Events(e => e.Error("errorHandler"))
// omitted for brevity
Error Handler
<script type="text/javascript">
    function errorHandler(e) {
        gridErrorHandler(e, "#test");
    }
 
 
//The below function lies in some js include files.
function gridErrorHandler(args, gridId) {
    if (args.errors) {
        var message = "We have encountered following errors : \n <ul>";
        $.each(args.errors, function (key, value) {
            if ('errors' in value) {
                $.each(value.errors, function () {
                    //alert(this);
                    if (this != "" && this != null)
                        message += "<li>" + this + "</li> \n ";
                });
                message += "</ul>";
            }
        });
        var kgrid = $(gridId).data("kendoGrid");
     
         
        kgrid.one('dataBinding', function (e) { //==> if we have only one grid in the view this works. for mutiple grids in view it does not trigger
            e.preventDefault();   // cancel grid rebind if error occurs 
        });
         
        showAlertWindow(message); //==> Some other function used to show kendo window with errror messages.
        
    }
}
</script>
I could verify that the kgrid is object but databinding event is not triggered in a view with multiple grids.

Any help is highly appreciated!!!

Thanks,
Petur Subev
Telerik team
 answered on 05 Sep 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?