I have datagrid which shows activity name and a checkbox column. User checks the checkbox if he/she wants to select that activity and presses submit button to successfully add it.
If user wants to un-check the checked checkboxes i have to make certain validation to check whether that activity is currently associated with any other thing or not.
How can i do that?
If the validation can be done on client side, add a template field to the GridView, add a CheckBox in the template field and attach a JavaScript event to it
Handle the JavaScript event and perform the validation. If the user unchecked the checkbox and validation fails, you may prompt the user and check the checkbox in JavaScript as shown:
This might help you in achieving what you are looking for. If you need any other help, you may put a comment.