CanExecute RadDataFormCommands.BeginEdit

2 posts, 0 answers
  1. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 27 Dec 2012 Link to this post

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 02 Jan 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top