This project is read-only.

How to add an image to the grids upper left corner?

Sep 3, 2015 at 4:50 PM
Edited Sep 3, 2015 at 4:55 PM
I just found Grid.Mvc and installed it in my MVC project and it works great! it was so easy to make this work, so intuitive. in minutes i was able to make a grid and make it sortable.

but as Im migrating across from the standard bootstrap/EF display to Grid.Mvc i wanted to ask about formatting questions, its now striped meaning alternate rows are shaded or not; would like to make it all one pattern?

the standard scaffolded EF layout draws the view using @foreach (var item in Model) and then for each row draws out the next successive contents of the next row, along with links and a link ID to edit/details/delete ?

so in the EF layout, each row comes with edit/details/delete. How can this be done with Grid.Mvc?

and i need to add our icon to the upper left area of the grid, is that possible?

Im somewhat new to mvc and web overall, did other kinds of sw, so what may seem obvious may not be to me

Jan 6, 2016 at 8:41 PM
Hey Rogers, not sure if you are still looking, but in case it helps I've posted code below for how I setup the Edit/Delete buttons in my own use of GridMVC followed by a standard field. My solution was to create Glyphicon Icons via Bootstrap classes that are hyperlinks to the appropriate controller actions directly passing the relevant Model ID:
    @Html.Grid(Model).Columns(columns =>
            columns.Add().Encoded(false).Sanitized(false).RenderValueAs(o => @<a href="/MY_Controller/Edit/@o.CLASS_ID" class="btn btn-primary btn-xs noDecoration"><span class="glyphicon glyphicon-pencil"></span></a>).SetWidth(15);
            columns.Add().Encoded(false).Sanitized(false).RenderValueAs(o => @<a href="/MY_Controller/Delete/@o.CLASS_ID" class="btn btn-danger btn-xs noDecoration"><span class="glyphicon glyphicon-remove-circle"></span></a>).SetWidth(15);
            columns.Add(o => o.FIELD2).Titled("Serial #").RenderValueAs(o => o.FIELD2).SetWidth(20);
            // ....etc....
catch (NullReferenceException ex)