Showing posts with label Kendo. Show all posts
Showing posts with label Kendo. Show all posts

Thursday, 20 December 2012

Kendo Tab Control

Using Tab control has always been an easy task to accomplish. But due to lack of sufficient documentation(IMO) of Kendo Tabstrip for MVC, it took me a while to get what i was looking for.

To begin with -
You can follow the basic documentation link of Kendo.
For everything else that was not exactly there in doc -
  1. Display image with absolute URL -  Simply use
    .ImageUrl("http://Absolute/path/of/the/image.")
  2. Display content from Partial View - I found a couple of ways for that. 
    1- .Content(@<text> @(Html.Partial("_PartialView1"))</text>);
     
    2- .Content(Html.Partial("_PartialView2").ToHtmlString());
    
    3- .Content(@<text> @(Html.Action("View3"))</text>);
  3. Change the animation from "expand" to "toggle" - 
  4. .Animation(animation =>
        {
            animation.Enable(true);
            animation.Open(config =>
            {
                config.Duration(AnimationDuration.Fast);
                config.Fade(FadeDirection.In);
            });
        })
    
  5.  Difference in LoadContentFrom  and Content in case someone is confused. 
     
Thanks,
S. Shafique
Fok at RnD Team member

Hide specify column in Kendo grid

Some of my Coolidge tried to hide one specify column in kendo grid table.

Finally I got the correct solution for the same.

Assuming #grid is already bound as the kendo grid, you can use the hide Column function

Your bound column is like
{ 
    field: "CreatedDate",
    title: "Create Date",

}
--------------------------------
Script for hiding the column

var grid = $("#grid").data("kendoGrid");
grid.hideColumn("CreatedDate");

or 
$("#grid").data("kendoGrid").hideColumn("CreatedDate");

you can supply the bound field or column index in hideColumn method

This will hide both the header and data column.There is also a showColumn
function when you need to show the column as well.



Thanks
V. K. Rajput
Fokat RnD Team member