The style property does not set the style attribute, but the class attribute. Yes, I know WTF. WebGrid component designers should have been mentally disturbed the moment they choose the name of this optional argument. All the dynamic and optional arguments that they insert into this component make me hate it like hell and never use it in any application.
In any case, you can define a custom CSS class in a separate CSS file:
.comments { width: 500px; }
and then assign the corresponding <td> elements to this class:
webGrid.Column(columnName: "TRP_Comments", header: "Comments", style: "comments")
source share