Values from checkbox

Nov 8, 2013 at 9:50 AM
Hi Tomasz,

When using a checkbox and edit the checkbox (as a checkbox) the values from that checkbox are incompatible with the type:
    [JqGridColumnEditable(true, EditType = JqGridColumnEditTypes.CheckBox)]
    [JqGridColumnFormatter(JqGridColumnPredefinedFormatters.CheckBox)]
    [Required]
    public bool RQ { get; set; }
Expected true/false, received No/Yes. Is there a way to tell jqGrid to use true & false?
Thanks in advance for your help!

Regards Gerard
Coordinator
Nov 8, 2013 at 1:09 PM
Hi Gerard,

In most cases the jqGrid should work as expected because its internals (the actual jqGrid component not the Lib.Web.Mvc helper) is trying to adjust the value type for the data it is receiving. In case where this mechanism doesn't work as expected you can set desired values manually like this:
[JqGridColumnEditable(true, EditType = JqGridColumnEditTypes.CheckBox, Value = "true:false")]
[JqGridColumnFormatter(JqGridColumnPredefinedFormatters.CheckBox)]
[Required]
public bool RQ { get; set; }
Regards,
Tomasz Pęczek
Marked as answer by TPeczek on 11/27/2013 at 2:28 AM
Nov 8, 2013 at 3:06 PM
Thanks, that works great!