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

how to set horizantal scroll bar to kendo grid only but not to whole page

2 Answers 306 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 08 Oct 2012, 05:24 AM
Hello,

I am new to Kendo and MVC 3, I want to show the horizontal scroll bar to Kendo Grid, when my columns are binded thru autogenerate. Currently the scroll bar appears at the bottom of the screen for the whole page. but I wont only for the grid. could anyone suggest how to do that ?

Thanks in advance.

Regards,
Ravi. 

2 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 08 Oct 2012, 02:49 PM
Try to assign a width to the grid dom element.

If that doesn't work, can you build a little example for your issue? www.jsbin.com / www.jsfiddle.net
0
Ravi
Top achievements
Rank 1
answered on 09 Oct 2012, 03:35 AM

Hello,

Please find the VIew below

<div id="grid456" align="left" style="border: 1px solid black; height: 400px; overflow-y: scroll; overflow-x: scroll;">

@{Html.Kendo().Grid(Model)

 .Name("GridSam")
 .Columns(c =>
              {
   c.AutoGenerate(column =>
   {
    //customize autogenereted column's settings
    column.Width = "150px";
    if (column.Member == "CustomerID")
    column.Visible = false;
   });

        })
 .Resizable(resizing => resizing.Columns(true))
 .Scrollable(scrolling => scrolling.Enabled(true).Height(400))
 .Sortable(sorting => sorting.Enabled(true))
 .Groupable(grouping => grouping.Enabled(true))
 .Filterable(filtering => filtering.Enabled(true))
 .Reorderable(reorder => reorder.Columns(true))
 .Pageable(Pageable => Pageable.Enabled(true))
 .Render();
}
</div>

Regards,
Ravi

 

Tags
Grid
Asked by
Ravi
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
Ravi
Top achievements
Rank 1
Share this question
or