I have a checkbox on my page, created as such:
@Html.CheckBoxFor(x => x.MyBoolValue)
Beneath that I have a WebGrid with sorting and paging, but on doing this I get a System.InvalidOperationException:
The parameter conversion from type 'System.String' to type 'System.Boolean' failed. See the inner exception for more information.
The inner exception is:
{"true,false is not a valid value for Boolean."}
I know this is due to the binding of the CheckBox and the underlying Hidden value. On a page GET I deal with this using Contains("true") on the query string value, but how can I do this when the WebGrid is refreshed?