Hello All
I currenly have a datagrid created from a SQL db table that contains a boolean\bit field. When I run the page the field is shown as true\false which is ok, however, how can i change this so it shows as a checkbox so the user can check\uncheck the box and that result then saved back to the database.
Ok, I am a step closer. I should’ve been more confident in my playing around
By entering the below code into the template column that i am looking to be a checkbox I get the box. Yay!
However, when you click on one checkbox all check boxes are selected. Also I havent worked out how to set the state of the checkbox yet.
All checkboxes are selected because they are all data-bound to the same property - isChecked.
There is an easier way to implement what you need without writing any code.
Edit the Template of that column via the template designer - click the "edit" icon (which is the last one).
Drag and drop a Checkbox component from the toolbox. Set its Value property to ${data.BooleanProperty} where BooleanProperty is the name of your boolean column.
Oh. My. God! I am speechless! That is actually easier than i expected and now i know what that icon does.
Feeling a little foolish but very pleased that it is solved. Thank you so much.
This seems to only work, the first time the checkbox is selected / clicked.
subsequent selections of the check box fails with "Update Failed".
This is the behavior of the "checkbox-column" working application.
I followed the "Checkbox-Column" example to add a checkbox to my data grid. and it works but only the first time.
the first time I select the check box, the Boolean value is successfully altered. however selecting the checkbox any number of times thereafter fails. "Update Failed"