Closed nazerulgit closed 2 weeks ago
this error is showing up when i set selecting to Selecting(true, SelectItems.Checkbox)
System.ArgumentNullException: Value cannot be null. (Parameter 'name') at System.Type.GetProperty(String name, BindingFlags bindingAttr)
this is my complete view code
@(Html.JS().Datatable<Person>() .Class("table table-hovered table-striped dataTable") .Name("datatable") .LengthMenu(new int[] { 5, 10, 25, 50, 100 }, true, "All Pages") .FixedColumns(leftColumns: 0, rightColumns: 1) .ColumnSearching(true, "form-control", SearchPosition.Header) .Columns(cols => { cols.Field(a => a.PerId).Title("Id"); cols.Field(a => a.PerName).Title("Name"); cols.Field(a => a.PerAddr1).Title("House No"); cols.Field(a => a.PerAddr2).Title("Street Name"); cols.Field(a => a.PerAddr3).Title("Unit"); cols.Field(a => a.PerTelMobile).Title("Mobile"); cols.Field(a => a.category).Title("Category"); cols.Field(a => a.PerEmail).Title("Email"); }) .ColReorder(true) .Orders(order => { order.Add(p => p.PerId, OrderBy.Descending); }) .URL(Url.Action("GetDataResultPeople"), "POST") .ServerSide(true) .StateSave(true) .Selecting(true, SelectItems.Checkbox) .Render() ) when i check the html created i realized that variable name in column defined datatable is '' <html>
this error is showing up when i set selecting to Selecting(true, SelectItems.Checkbox)
System.ArgumentNullException: Value cannot be null. (Parameter 'name') at System.Type.GetProperty(String name, BindingFlags bindingAttr)
this is my complete view code
columns: [{ -- | data: '', | name: '', | defaultContent: '', | orderable: false, | searchable: false, | className: 'select-checkbox', | visible: true, | width: '5%', | | }, {