This question is locked. New answers and comments are not allowed.
When I add the databinding code to my grid...
I get the "Object reference not set to an instance of an object..." error. I removed the actual actions as in the code above and it still gives the error - immediately, the grid never binds.
I am not really getting why it would be throwing this error. Here is my grid:
As soon as I take the databinding code out it works (but obviously I can't edit or delete). Any help is appreciated!
Thanks!
.DataBinding( db => db.Ajax() )I get the "Object reference not set to an instance of an object..." error. I removed the actual actions as in the code above and it still gives the error - immediately, the grid never binds.
I am not really getting why it would be throwing this error. Here is my grid:
@(Html.Telerik().Grid(Model.CartItems) .Name( "GridCart" ) .DataKeys( keys => keys.Add( i => i.RecordId ) ) .DataBinding( db => db.Ajax() ) .Columns( columns => { columns.Bound( invItem => invItem.RecordId ).Hidden( true ).ReadOnly( true ); columns.Bound( invItem => invItem.ECCatalogInventoryItem.ShortDescription ).ReadOnly(true); columns.Bound( invItem => invItem.ECCatalogInventoryItem.Price ).ReadOnly(true); columns.Bound( invItem => invItem.Quantity ); columns.Bound( invItem => invItem.LineTotal ) .FooterTemplate( @<text> Total:@string.Format( "{0:c}", Model.CartTotal ) </text> ).Width( 100 ).Format( "{0:c}" ); }) .PrefixUrlParameters( false ) .Scrollable( scrolling => scrolling.Enabled( false ) ) .Sortable( sorting => sorting.Enabled( false ) ) .Pageable( paging => paging.Enabled( false ) ) .Filterable( filtering => filtering.Enabled( false ) ) .Groupable( grouping => grouping.Enabled( false ) ) .Editable( editing => editing.Mode( GridEditMode.InLine ) ) .Footer( true ) .Selectable() .Resizable( resizing => resizing.Columns( true ) ))As soon as I take the databinding code out it works (but obviously I can't edit or delete). Any help is appreciated!
Thanks!