Search code examples
kendo-uikendo-gridkendo-asp.net-mvc

MVC Kendo Grid Style


Is there any way to add Style to the .Title(title) I want to be able to center and the change the background color?

    @(Html.Kendo().Grid(pvm)
    .Name("grid" + i)
    .ToolBar(toolbar =>
    {
        toolbar.Template(
        @<text>
        <div class="toolbar">
        <div class="row">
        <div class="col-md-4">
        <div class="input-group">
        <input type="text" class="form-control" id='FieldFilter' placeholder="Filter Results....">
        </div>
        </div>
        </div>
        </div>
        </text>);
        })
    .Columns(columns =>
    {
        columns.Group(group => group
        .Title(title)
        .Columns(info =>
        {
        info.Bound(x => x.PanelName).Width(200);
        info.Bound(x => x.MeetingDate).Width(200);
        info.Bound(x => x.Type).Width(200);
        })
    );
})
)

Solution

  • You can style the header with css. See this example below;

    #MyGridID .k-grid-header .k-header 
    {
        background-color: red;
        text-align: center;
    }
    

    Where #MyGridID is the name of your grid.