This is a migrated thread and some comments may be shown as answers.

setting RetrieveAllDataFields to false in a Razor view?

0 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JT
Top achievements
Rank 1
JT asked on 19 Jan 2012, 05:48 PM
We are using the MVC grid control with Razor in VB.  When I attempt to bind to the grid, I get an exception when one of the date columns that is passed back in the model contains a null.  When it doesnt contain a null, then it works fine.  I do not want the grid to try to bind this column at all - I do not need it in this view.  Is there a way to limit the columns that the grid is trying to use? 

I found this entry which seems to address the problem, but I do not see how to apply this in a Razor view.  Can anyone help? 

Here is the code from my View:

 

 

@(Html.Telerik().
    Grid(Model).
    Name("Grid").
    Columns(Sub(columns)
                    columns.Bound(Function(o) o.DocumentId).Width(20)
                    columns.Bound(Function(o) o.StatusCode).Width(20).Title("Status")
                    columns.Bound(Function(o) o.LastName).Width(10).Title("LastName")
                    columns.Template(Function(o) Html.ActionLink("View", "View", New With {.id = o.Id}))
            End Sub).
        Pageable.
        Sortable)
    )

 

 

 

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
JT
Top achievements
Rank 1
Share this question
or