I'm working with hierarchy grid kendo ui. I want to hide grid header. Currently, I use the code as below, however, only hide text of header.
// kendo ui grid
.TableHtmlAttributes(new { @class = "GridNoHeader" })
// css
.GridNoHeader thead.k-grid-header
{
height: 0;
border-bottom-width: 0;
visibility: hidden;
overflow: hidden;
}
Please share your experience if you can. Thanks
Solution. Toggle the visibility of the column by using the built-in methods of the Grid. Within the beforeEdit event handler, show the column by using the showColumn method. When the save event is fired, hide the column by using the hideColumn method.
kendo:grid-pageable-messagesThe text messages displayed in pager. Use this option to customize or localize the pager messages.
Kendo UI Grid is an easy, more maintainable, and powerful control for displaying data in a tabular format. Kendo provides many options, such as paging, sorting, filtering, grouping, and editing. These features determine the way data is presented and manipulated.
Here is a jQuery way which you can run immediately after the grid has been initialized:
$("#grid .k-grid-header").css('display', 'none');
It hides the whole header, and is slightly better than the css solution because it applies the style directly to the header as an inline style, meaning that the style automatically has higher priority over all other kendo styles.
Regarding your current way, it only hides the text because visibility:hidden
will hide the element, but space is still allocated for it. Try with display:none
. Furthermore, the k-grid-header
class is applied to the div
element that contains the whole header, not on thead
. Maybe try this:
.GridNoHeader div.k-grid-header
{
height: 0;
border-bottom-width: 0;
display: none;
overflow: hidden;
}
To hide grid header, please use the code as below:
.GridNoHeader .k-grid-header
{
height: 0;
border-bottom-width: 0;
display: none;
overflow: hidden;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With