Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 347
genxgeek Avatar asked Oct 21 '11 03:10

genxgeek


1 Answers

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>
like image 94
Stephen Avatar answered Nov 12 '22 10:11

Stephen