Does MVC3 WebGrid support horizontal scrollbars?
Asked Answered
F

1

5

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)?

Francium answered 21/10, 2011 at 3:30 Comment(0)
S
11

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>
Steiner answered 21/10, 2011 at 5:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.