Feb 14, 2017, 8:46 PM
How to insert an editiable checkbox column into the Grid Spreadsheet?
Hi there,
I am quite new to Ext.Net MVC we have a Grid Spreadsheet created using the Overview example. Now we require to insert a Checkbox which will show and allow enable disable 'Hide in Portal' attribute which is stored in database and in our model.
Currently we have it functioning with the boolean values (true, false) shown and editable using the following bit of code:
Here's a bit more of the column list showing
I am quite new to Ext.Net MVC we have a Grid Spreadsheet created using the Overview example. Now we require to insert a Checkbox which will show and allow enable disable 'Hide in Portal' attribute which is stored in database and in our model.
Currently we have it functioning with the boolean values (true, false) shown and editable using the following bit of code:
X.ColumnFor(Model, m => m.PortalHide).ToBuilder<Column.Builder>()
.Flex(1)
.ID("PortalHide")
.Align(ColumnAlign.Start)
.Editor(X.TextField().NoteEncode(true).AllowBlank(false).StandardVtype(ValidationType.None).MaxLength(5).MaxLengthText("The maximum length for this field is 5."))
//.Renderer(RendererFormat.Checkbox)
.Text("Hide in Portal")
.Filter(X.ListFilter().Options(@ViewBag.portalHideList)),
Trying various snippets to insert a functional checkbox has been unsuccessful. Any help is appreciated.Here's a bit more of the column list showing
.ColumnModel(
X.ColumnFor(Model, m => m.ID).ToBuilder<Column.Builder>()
.Renderer("return record.phantom ? '' : value;")
.Hidden(true),
X.ColumnFor(Model, m => m.ProductID).ToBuilder<Column.Builder>()
.Hidden(true),
X.ColumnFor(Model, m => m.AOGCategory).ToBuilder<Column.Builder>()
.Flex(1)
.ID("AOGCategory")
.Align(ColumnAlign.Start)
.Editor(X.TextField().NoteEncode(true).AllowBlank(true).StandardVtype(ValidationType.None).MaxLength(100).MaxLengthText("The maximum length for this field is 100."))
.Filter(X.ListFilter().Options(@ViewBag.categoryList)),
X.ColumnFor(Model, m => m.PortalHide).ToBuilder<Column.Builder>()
.Flex(1)
.ID("PortalHide")
.Align(ColumnAlign.Start)
.Editor(X.TextField().NoteEncode(true).AllowBlank(false).StandardVtype(ValidationType.None).MaxLength(5).MaxLengthText("The maximum length for this field is 5."))
//.Renderer(RendererFormat.Checkbox)
.Text("Hide in Portal")
.Filter(X.ListFilter().Options(@ViewBag.portalHideList))
)