Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can hide/show a Kendo Grid

So this is my grid and what I need is to have it hidden when the page is rendered and to show it when I click the search Button. Any ideas??

    @Html.WebCore().LinkButton(ButtonType.Zoeken, cssClass: "myZoekenButton") 


    @(Html.Kendo().Grid<AanvragenZoekenViewModel.ZoekResultaat>()
        .Name("Grid")
        .Columns(columns =>
        {
...
            columns.Bound(zoekResultaat => zoekResultaat.Opmerkingomschrijving).ClientTemplate("#= Opmerkingomschrijving#").Hidden(Model.DossierLijst);
        })
...
        .AutoBind(false)
        .DataSource(dataSource => dataSource
            .Ajax()
            .Batch(true)
            .Events(e => e.Error("onErrorhandling"))
            .Model(model =>
            {
            })
            .Read(read => read.Action(MVC.Dashboard.ActionNames.ReadItems, MVC.Dashboard.Name).Data("onReadAdditionalData"))
            .PageSize(500)
        )    
    )
like image 745
Rui Martins Avatar asked Sep 19 '14 15:09

Rui Martins


People also ask

How do you hide a kendo grid?

Hiding the column in Kendo Grid is done simply by using the hidden property as in the following HTML design.

How do you hide a kendo control?

Kendo grid doesn't have HIDE/SHOW property. You need to do this in JQuery. At run time, kendo grid will convert it into DIV tag. you need to hide/show DIV tag in jquery.

How do you hide a command column in Kendo grid?

You need to add the field property to your command column. The hideColumn/showColumn actions use either the column number or column field "name".

How do I make my Kendo grid read only?

k-button and/or . k-button-icontext) to set readonly or disabled. The toolbutton works, but the in-row Edit and Delete buttons may not be changed (always clickable).


1 Answers

Kendo grid doesn't have HIDE/SHOW property. You need to do this in JQuery.

At run time, kendo grid will convert it into DIV tag.

you need to hide/show DIV tag in jquery.

(Div id will be name of grid )

Hide grid on page Load

$(document).ready(function() {
   $( "#Grid" ).hide();
});

Show grid on button click

$('#button').click(function(){
  $('#Grid').show();
});
like image 58
Krushnakant Ladani Avatar answered Oct 19 '22 20:10

Krushnakant Ladani