Click here to Skip to main content
13,900,319 members
Rate this:
Please Sign up or sign in to vote.
See more:
StackOverflow Link

One of my project page contains Kendo hierarchy grid. The inner grid contain 3 combo boxes

When I select an item form 3rd combo box. A new grid row will insert below the existing row.

The problem is after adding the new row the selected values of the first 3 combo boxes are resetting..

Inner Grid Code

            .Columns(columns =>
                columns.Bound(o => o.Area).ClientTemplate("<input id='areaCombo_#= UserId #' >").Width("25%");
                columns.Bound(o => o.Application).ClientTemplate("<input id='applicationCombo_#= UserId #'>").Width("25%");
                columns.Bound(o => o.UserLevel).ClientTemplate("<input id='userLevelCombo_#= UserId #'>").Width("25%");
            .Events(events => events.DataBound("dataBound"))
            .DataSource(dataSource => dataSource
                        .Read(read => read.Action("BindHierarchy", "Security"))

function dataBound() {


        var dataSourceArea = new{
            transport: {
                read: {
                    url: "GetAreaListForComboBox"

        $.each($("[id^=userLevelCombo_]"), function () {
            element = this;
                dataSource: dataSourceUserLevel,
                dataTextField: "Value",
                dataValueField: "Key",
                filter: "contains",
                placeholder: "---Select---",
                change: function (e) {


    function CreateNewGridRow() {
        var grid = $("#SubGridSecuritySection").data("kendoGrid");
        if (grid) {
            var dataSource = grid.dataSource;
            var total =;
            dataSource.insert(total, {});

How to fix this issue..?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Get the value of combo box and set the value after inserting the new row explicitly.

function CreateNewGridRow() {
        var selectedValue = $('#comboBoxId').data('kendoComboBox').value();
        var grid = $("#SubGridSecuritySection").data("kendoGrid");
        if (grid) {
            var dataSource = grid.dataSource;
            var total =;
            dataSource.insert(total, {});
       $('#comboBoxId').data('kendoComboBox').value(selectedValue );
Thank you very much Satya for your answer..
It is working... (Y)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190306.1 | Last Updated 12 Oct 2014
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100