We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use CheckBoxFor with integer instead of boolean

Thread ID:





131773 Jul 26,2017 01:57 PM UTC Aug 1,2017 02:57 PM UTC ASP.NET MVC 3
Tags: Checkbox
Asked On July 26, 2017 01:57 PM UTC

in my application I have some DB model, created automaticaly by entity frawework, 
there are integer fields instead of boolean to store true (1) and false (0).
If I use this html helper 


get an System.InvalidCastException

It is possible use an Integer value with CheckBox ? How ?


Berly Christopher [Syncfusion]
Replied On July 27, 2017 01:27 PM UTC

Hi Nicola, 
Thanks for contacting Syncfusion support. 
We have checked with your query and we suggest you to use below solution to achieve your requirement (using integer value with checkbox).  
Here we have maintained the Boolean type member which will convert to/from integer to bool. 
Also, please refer below forum link to know more about this, 
Berly B.C 

Replied On July 31, 2017 01:26 PM UTC


Berly Christopher [Syncfusion]
Replied On August 1, 2017 02:57 PM UTC

Hi Nicola,

Thanks for the update. We are happy to hear that the issue is resolved at your end. Please get back to us if you need any further assistance on this.


Berly B.C


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon