Martin Volek
Martin Volek

Reputation: 1099

Grid.Mvc table css class

Maybe I am blind, but I am not able to find how to change css class attributte for entire table generated by Grid.MVC.

Default css class settings:

<table class="table table-striped grid-table">

And I want to edit that. I have a workaround now in javasript. It works but there has to be some better solution at server side.

Upvotes: 2

Views: 14253

Answers (2)

Martin Volek
Martin Volek

Reputation: 1099

I finnaly found that there is a shared view in ~/Views/Shared (_Grid.cshtml). There you can edit the whole grid.

Upvotes: 11

MikeV
MikeV

Reputation: 585

You don't want to assign styles on the server side. You always want that to happen on the client side. the classes you are referencing in your table tag are the reason why your table looks the way it does. If you want to change the look of the table you have three choices:

  1. You can create new CSS style classes and add them to your CSS and change the referenced classes in your table tag.
  2. You can edit the existing CSS classes in the CSS file to suit your needs.
  3. You can override the style you want by adding them inline on your table tag using the style attribute.

Edited to add:

According to the documentation for Grid.Mvc you can change your table styles in Content/Gridmvc.css

Upvotes: 0

Related Questions