Hi,
i am using BoundcheckboxField in webdatagrid. i want some checkbox ReadOnly and some of them
editable, how can i do this?
Hi Mypost,
You should do this similarly to how make some cells in a column read-only. You probably should just handle valueChanging client event on editing core and for the rows you want readonly for this column, set args.set_cancel(true);
regards,David Young
Thanks for reply.
can you show me any example?
Here is a small snippet illustrating how cell value change may be conditionally cancelled in WebDataGrid:
Feel free to contact me if you have any questions.
Canceling the Cell_Value_Changing event on checkboxes via javascript works well for making checkboxes readonly. However for regular cells that are editable, handling the Cell_Value_Changing and then canceling it does not give you the "disabled/readonly" effect. The cell still appears editable, the user can attempt to change the value and then we cancel the event which prevents the value from changing.
For non-checkbox cells I was handling the Before_Enter_Edit event and canceling that in order to give the desired "Disabled/Readonly" behavior which seems to work well.
But this means I now need to handle two unrelated events based on cell editor type just to get a simple readonly effect on the client.
Is there a cleaner way than this where I can handle a single event that works for both scenarios?
Please feel free to contact me if you have any further questions regarding this matter.