genxgeek
genxgeek

Reputation: 13367

Does MVC3 WebGrid support horizontal scrollbars?

I have a record set that is quite wide (about 25-30 cols)...does MVC3 WebGrid support horizontal scrollbars (or can I house the grid in a html tag/control)?

Upvotes: 5

Views: 5618

Answers (1)

Stephen
Stephen

Reputation: 1737

Never realised about the WebGrid, so had to play with it to help on this one.

Basically, if you put the webgrid inside a div with an overflow set, then it seems to work fine.

I tested it on mine with the following code (I just shrank the test div to simulate small screen/many rows (was to lazy to create loads of col/properties, lol.

<div class="test" style="overflow: scroll; width: 150px">
    <div style="width: 1000px">
        @grid.GetHtml()
    </div>
</div>

Upvotes: 11

Related Questions