I have a string field IsEnabled, it’s string. Value can be Yes, No or null. I am binding this column to grid column. It’s working as expected. But I want to show this on UI as checkbox. For value Yes, it should be checked or No or null it should be unchecked. And user can check/uncheck, based on user’s action. Yes or NO will be inserted in database.
I couldn’t find proper way of doing this, so what is the best way to handle this scenario?
I have tried by by adding one more bool field and setting it based on value Yes, No or null. And binding this field to grid.
But I am looking for a clean approach
As I was looking for a Kendo MVC solution, So I have implemented it like the below.
Declare the property like this.
Add view under Views\Shared\EditorTemplates create the view named as DropDownTemplate with below content
In the controller action method, add the below code.