This is a migrated thread and some comments may be shown as answers.
CanExecute RadDataFormCommands.BeginEdit
1 Answer 26 Views
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 27 Dec 2012, 09:08 PM
When I hit the Add button in the DataForm, all other buttons are disabled except the Save and Cancel.  At this point there are fields that are not valid (required for instance), but the user can still hit Save.  Validation kicks in, but I would prefer that the Save button would remain disabled until all fields are valid.

When the Edit button is hit, only the Edit button is disabled.  If the user edits the form, the record is now dirty, but the user is able to hit any of the other buttons (Add, Delete, or the Navigation buttons).  Now granted if you navigate to another record and then come back your changes are still there, but the Save and Cancel buttons are disabled until you hit edit again.  At this point Cancel does not remove any changes.  I am not using AutoCommit.

I would prefer that Edit would disable all the other commands, and Save would only become enabled when the user actually makes a change, and as with the Add button, Save would remain disabled until all fields are valid.

I assume you have valid reasons for the current implementation; however I would like to be able to override this behavior with the aboved described behavior.  Can you provide any guidance?

What I'd really like is to have control over the CanExecute method of the commands.  Is there any way to acheive this?

Thanks in advance,
Steve

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 02 Jan 2013, 09:51 AM
Hi Steve,

Generally, if you want to change the behavior of the commands executed on the form's buttons, you will need to create your own and handle their Execute and CanExecute methods. For the time being this could be done only by updating the template of RadDataForm and placing new buttons.  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Asked by
Steve
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or