views:

371

answers:

2

I am using mvccontrib grid in asp.net mvc(C#) application.

How can i apply css class to the grid thats created for the mvccontrib grid Attributes?

I am looking to construct like:

<table border="0" cellspacing="0" class="usertable">....</table>

By default, the mvccontrib grid has the class "grid". I need to change it to my custom css class

+2  A: 
Html.Grid(x).Columns(col => {}).Attributes(@class => "usertable");

By the way MvcContrib's Grid should have full intellisense so you should see all the available methods when you type "." (dot).

queen3
A: 

IF you are looking to add multiple classes, the way I would recommend would be to do so via jQUery:

$("table").addClass("foo");

more info at http://docs.jquery.com/Attributes/addClass

James Fleming