This is a migrated thread and some comments may be shown as answers.

Hide header row?

3 Answers 1259 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 14 Sep 2012, 03:11 PM
I have two grids on top of one another, showing different data but using the same column layout. Don't ask why; it's a market research thing.

To save space, I really don't need the header row for the second grid, since it aligns with the header columns for the first grid.

How to get rid of header row for the second grid and use that saved space for data rows?

I've tried this, but it leaves a gap at the bottom of the grid instead of distributing the saved space to the rest of the grid.
#cntr-bnch .k-grid-header {
    display               : none;
}

3 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 14 Sep 2012, 03:22 PM
I actually just tried this and it works, but is there a better method?

heit = Math.floor($("#cntr-bnch").find(".k-grid-header").height());
$("#cntr-bnch").find(".k-grid-header").hide().siblings(".k-grid-content").height($("#cntr-bnch .k-grid-content").height() + heit);
0
Michal
Top achievements
Rank 1
answered on 05 Dec 2012, 10:31 AM
You can do this using headerAttributes in grid definition. Just insert "display: none" for each column.
columns: [{
    field: "field_1",
      ...
    headerAttributes: {
        style: "display: none"
    }
}]
0
Garðar
Top achievements
Rank 2
answered on 28 Oct 2013, 01:36 PM
Michals answer worked for me, thanx  :)
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Michal
Top achievements
Rank 1
Garðar
Top achievements
Rank 2
Share this question
or