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

Can't enable horizontal scrolling in grid

2 Answers 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Vallelunga
Top achievements
Rank 1
Brian Vallelunga asked on 29 Apr 2013, 07:06 PM
I can not get my grid to scroll horizontally at all. I'm using the MVC wrapper and have the following code:

@(
Html.Kendo()
    .Grid<MyModel>
    .Name("grid")
    .DataSource(…)
    .Scrollable()
    .Columns(columns =>
    {
        columns.Bound(…).Width(300);
        columns.Bound(…).Width(200);
        columns.Bound(…).Width(300);
        columns.Bound(…).Width(200);
        columns.Bound(…).Width(200);
        columns.Bound(…).Width(500);
    })
)

This results in a table that squishes the columns to fit the width of the table, instead of triggering a horizontal scroll bar. The grid's content table has a table-layout of "fixed" with a width of 100%. The problem seems to be that inside of the generated tables is a nested colgroup. Instead of:
<table><colgroup><col /><col /></colgroup>...</table>
I see 
<table><colgroup><colgroup><col /><col /></colgroup></colgroup>...</table>
What could be causing this? I'm using the latest version (2013.1.319). What's interesting is that this only appears in how the colgroup is parsed and rendered by the browser. The actual source only has the single colgroup element. Check out the attached screenshot to see what Firebug displays versus the source. There is a difference between what I see in "View Source" and "View Generated Source".

Just a guess, but is the kendoGrid jQuery call adding an additional colgroup? It seems the MVC helper is already building a table with it.


2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 30 Apr 2013, 06:58 AM
Hello,

 Nested colgroups are caused by a bug in jQuery 2.0. Either use jQuery 1.9.1 or download the latest Kendo UI build which circumvents this bug.

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian Vallelunga
Top achievements
Rank 1
answered on 30 Apr 2013, 12:42 PM
Ahh, thanks for the heads-up.  I ended up writing a few lines of script to simply remove the nesting after the grid has been databound. This works around the problem for the moment.
Tags
Grid
Asked by
Brian Vallelunga
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Brian Vallelunga
Top achievements
Rank 1
Share this question
or