I am using the new BoundCheckBoxField and I want it to postback each time the checkbox is clicked so I can update the database.
Is this possible?
I really don't want to have an "update" button anywhere and this is the ONLY column in the grid that is editable.
Hi RBonser,
This should be possible. There is no autopostback flag, but you can commit the value. What you should do is handle the ValueChanged client event off of the EditingCore behavior. In that, you could check for the correct column key and then call commit off of the editing core behavior.
var grid = $find("WebDataGrid1");
var editingCore = grid.get_behaviors().get_editingCore();
editingCore.commit();
You may need to handle the RowUpdating or RowUpdated server event for EditingCore in order to make row updating not do its batch mode. I think commit is fixed so it should go back. Hopefully this is what you're looking for. Let me know if you have any other trouble with the new column or see room for improvement in it.
regards,David Young
Okay, so next question... Is it possible to enable/disable this checkbox on a row by row basis?
Hi,
This could be done with some client code. What you would need to do is handle the valueChanging client event on the editing core. This should have a reference to the cell that is being updated. Then you can get the row. Based upon some condition on your row, you could call args.set_cancel(true) to prevent the checkbox from switching values, effectively making it readonly. There was a bug that was fixed regarding this event args. I'm not positive if it made it into the RTM or if it resolved in the first service release. If args.get_cell() returns null, you'll need to use args._cell until you upgrade to the Service Release.
thanks,Dave