Questions tagged [mvccontrib-grid]
92 questions
10
votes
1 answer
How to style rows in the MVCContrib Grid based on their data?
I am tinkering with the MVCContrib Grid and am stuck on how to format a row of data in the grid based on the data.
For example, say we have a grid of products, where each product has data fields like name, price, and discontinued. I'd like to…

Scott Mitchell
- 8,659
- 3
- 55
- 71
10
votes
3 answers
MvcContrib grid and checkboxes
Lets say I render a Checkbox:
@Html.CheckboxFor(x => x.Checked) // Checked is true by default
ASP will turn that as:

Sheldor the conqueror
- 1,154
- 9
- 15
9
votes
2 answers
MvcContrib grid conditional cell formatting based on model value
I need to conditional formatting a cell value based on a boolean value in the model.
I have the column col.For(item => item.Detail);
If item.Unfinished I need to apply some css style
How can I do that?

Rodrigo Juarez
- 1,745
- 1
- 23
- 38
6
votes
2 answers
Advanced Column Rendering for MVCContrib Grid with MVC3 Razor
I'm trying to build a custom column for an MVCContrib grid, but an getting tripped up by the Razor syntax. Here is my code for building a custom column:
@{Html.Grid(Model).Columns(column =>
{
column.For("Data").Do(p => {
…

user330468
- 381
- 2
- 4
- 6
6
votes
1 answer
Can footers be added to MVCContrib grids?
I'd like for my column header to also be footers using MVCContrib grid. How can I add footers?
<% Html.Grid(Model).Columns(col =>
{
col.For(c => c.sub_id).Named("Id");
col.For(c => c.name).Named("Name");
col.For(c =>…

RememberME
- 2,092
- 4
- 37
- 62
5
votes
1 answer
How to use a custom column in a Mvccontrib Grid Model?
I am using a ASP.NET MVC 3 Mvccontrib grid like so:
@Html.Grid(Model).Columns(column =>
{
column.For(x => x.UserId).Named("ID");
column.For(x => x.Name);
column.Custom(@
4
votes
3 answers
Using HTML.Grid to display child object
I have an ASP.NET MVC application that is using a single view to display the properties and children (with their properties) of a model entity.
My model looks something like this:
public class Market
{
public int ID { get; set; }
public…

Bill Sempf
- 976
- 2
- 13
- 40
4
votes
1 answer
MVCContrib Grid - how to add and delete rows with ajax?
I'm wondering what's the best strategy to delete a row in MVCContrib generated grid.
Consider this grid:
Html.Grid(Model.Proc.Documents).Columns(column =>
{
column.For(c => c.Name).Named("Title");
column.For(c =>…

user315648
- 1,945
- 3
- 22
- 30
4
votes
1 answer
Format boolean column in MVCContrib grid
I am using the MVCContrib grid and I would like to display images depending on the values of a column, e.g.:
if the column's value is null display the image "
"
otherwise display the image "
Furthermore I…



Stefan Walther
- 929
- 1
- 8
- 30
4
votes
1 answer
MVCContrib grid - Can I specify tbody attributes?
I'm trying to use MVCContrib grid together with KnockoutJS. To do this I have to specify data binding in tbody, e.g. . I can't find the way how to do this.
@Html.Grid(Model).Attributes() applies my binding to…

Lukasz Lysik
- 10,462
- 3
- 51
- 72
3
votes
3 answers
Multiple Html.ActionLink() within single MvcContrib.Grid column in MVC3
I'm trying to wrap my head around the proper syntax to achieve the following--or at least to find out if it's even do-able or if there is a better alternative solution.
Ok, out of the box, when you generate a strongly-typed View using the List…

jT1014
- 33
- 1
- 5
3
votes
2 answers
How to make a pager with MVCContrib and Razor?
I have a pager as follows:
@using MvcContrib.UI.Pager
@model MvcContrib.Pagination.IPagination
@Html.Pager(Model).First("First").Last("Last").Next("Next").Previous("Previous")
Instead of displaying this:
Showing 1 - 10
of 10841…

Bruno Machado - vargero
- 2,690
- 5
- 33
- 52
3
votes
1 answer
Problem with razor view and mvccontrib grid pagination
I have the following partial view code
@model IEnumerable
@using MvcContrib.UI.Grid;
@using MvcContrib.UI.Pager;
@using MvcContrib.Pagination;
@Html.Grid(Model).Columns( column => {
column.For( u…

Lorenzo
- 29,081
- 49
- 125
- 222
3
votes
1 answer
Overriding the default 'No Data' Message in MVCContrib Grid
Is it possible to override the default 'There is no Data available' message in MVCContrib Grid with a custom message?

MrBliz
- 5,830
- 15
- 57
- 81
3
votes
2 answers
MVCContrib grid - sorting a custom column
Just started learning to use the grid so please excuse me for the possibly trivial question.
How can I sort by a column that uses another table property?
For ex.
column.For(cust => cust.LinkedTable.someProperty).Sortable(true); definition results…

pklosinski
- 219
- 3
- 9