forum

Home / DeveloperSection / Forums / ASPX View MVC3 WebGrid format column

ASPX View MVC3 WebGrid format column

Mark Devid 3280 20-Nov-2014
<%{
     WebGrid studentGrid = new WebGrid(rowsPerPage: StudentController.PageSize);
     studentGrid.Bind(Model.Students, autoSortAndPage: false, rowCount: Model.RowCount);
     studentGrid.PageIndex = Model.CurrentPage;
}%>
<%=studentGrid.GetHtml(columns: new WebGridColumn[]{
    studentGrid.Column("StudentId", "Id"),
    studentGrid.Column("Name", "Name"),
 })%>

Unfortunatly i am forced to use aspx view in my MVC3 project.

I want to have a column that shows a text "select" or "remove" based on some condition of the list item that is bound to the grid.

How is the sysntax to do that

I have to get render html like

<span class="1" id=item.id>Select<span>

and the html shown will be just Select


Updated on 20-Nov-2014

Can you answer this question?


Answer

1 Answers

Liked By