Grid Displays Incorrectly When JSON Data Replaced

3 posts, 0 answers
  1. Mark
    Mark avatar
    3 posts
    Member since:
    Aug 2016

    Posted 30 Sep Link to this post

    I am loading a complex JSON object via AngularJS. The object contains several child collections that I want to display in Kendo UI grids. When I first load the page, the object doesn't exist at all. Periodically, the user can use a master list (not included here) to change the entire JSON object.

    So far, I have the object loading correctly and displaying/working with AngularJS integration for the basic fields. The grid in question is configured to appear inside a Kendo TabStrip, as part of an AngularJS directive that displays my entire child form.

    I currently define the grid (and tabStrip) in the Angular HTML template for the directive as:

    <div class="detailTabStrip" kendo-tab-strip k-content-urls="[ null, null]">
        <!-- tab list -->
            <li class="k-state-active">Facility Types</li>
        <div style="padding: 1em">
            <kendo-grid k-options="typeSnapshotGridOptions" k-scope-field="typeSnapshotGrid" style="height:99%;width:100%">
        <div style="padding: 1em">

    My controller supplies the grid options:

    $scope.typeSnapshotGridOptions = {
        dataSource: {
            data: [],
            pageSize: 5,
        sortable: true,
        groupable: false,
        resizable: true,
        useStaticHeaders: true,
        allowScroll: true,
        selectable: "row",
        pageable: {
            refresh: false,
            pageSizes: false,
            buttonCount: 5
        autoSync: true,
        //dataBound: function () {
        //    this.expandRow(this.tbody.find("tr.k-master-row").first());
        columns: [(...omitted for brevity...)]

    And, when the JSON object is changed, it reinitializes the grid:

    $scope.$on('facilitySelected', function (ev, args) {
        kendo.ui.progress($('#facilityDetailSection'), true);
        $http.get('/FacAdmin/GetFacilityDetail/' + args.facilityID)
            .then(function (response) {
                $scope.facility =;
                kendo.ui.progress($('#facilityDetailSection'), false);


    As far as displaying data goes, this all works. The grid starts off invisible (because I have an ng-show vanishing the entire pane if there is no data), and it appears and shows the correct child rows each time I load a new complex JSON object.


    However, the appearance is horrible. The grid appears about 100px tall (despite settings for 100% height and width, and use of useStaticHeaders and allowScroll) the very first time I load a JSON collection into it. On the second and subsequent loads, the grid appears the correct size and is almost right... the last row is missing the bottom border.


    I have tried:

    • * refresh()
    • * dataSource.sync()
    • *
    • * replacing the datasource instead of replacing the just the data

    None of these had the slightest effect.

    I am testing in Chrome and Chrome's debugger reports no JS errors. My Telerik version was installed from telerik.kendoui.professional.2016.2.714.commercial, which I assume also represents the version number.

    Attached: Screenshot of grid appearance on first load of the child collection (_1) and on subsequent loads (_2).

    Please suggest additional possible fixes.

  2. Dimiter Topalov
    Dimiter Topalov avatar
    317 posts

    Posted 04 Oct Link to this post

    Hi Mark,

    The scenario needs a call to the Grid resize() method, so that the Grid assumes the height of its containing tab, as demonstrated in the following how-to article from our documentation:

    Further information about setting 100% height is available in the following section of our documentation:

    The last Grid row does not have bottom border by default to avoid duplicate borders when the Grid rows are enough to fill the available space (the typical scenario). You can display the bottom border of the Grid contents table via CSS, but please mind that when there are enough rows in the table, this will lead to duplicate border at the bottom.

    I have modified the example to illustrate both situations:

    I hope this helps.

    Dimiter Topalov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  3. Mark
    Mark avatar
    3 posts
    Member since:
    Aug 2016

    Posted 05 Oct in reply to Dimiter Topalov Link to this post


    First, thanks for the clarification about the bottom border.

    Second... re the sizing, I think you've identified the right problem, but I am having trouble getting this to work within an AngularJS directive. I can probably manage it by mixing JQuery with Angular, but I'm reluctant to do that. Do you have any examples, or can you create one, in which the tabstrip and grid are both defined by AngularJS attributes, including k-scope-field, and in which the "one()" event handling is set up inside an Angular controller?

  4. Mark
    Mark avatar
    3 posts
    Member since:
    Aug 2016

    Posted 05 Oct in reply to Mark Link to this post


    I was able to fix it by adding this link function to the directive:

                link: function (scope, elem, attr) {

    This sizes the grid after the directive has been expanded, which apparently is the right place.

    So my problem is solved -- thanks!

Back to Top