4

I tried:

@Html.Grid(Model.PagedList).Columns(column =>{
    column.For(m => m.Name).Attributes(@class => "test");
})

But that just added it to the tag inside the grid.

Steven
  • 18,761
  • 70
  • 194
  • 296

2 Answers2

6

You could use HeaderAttributes:

column
    .For(m => m.Name)
    .Attributes(@class => "test")
    .HeaderAttributes(@class => "someheaderclass");
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
1

While your solution is more suitable in this context, you could use more general approach with jQuery adding this line somewhere in JavaScript code below:

$('th').addClass("test");
Alexander Prokofyev
  • 33,874
  • 33
  • 95
  • 118