RadButton disabled by default?

4 posts, 0 answers
  1. Craig Mellon
    Craig Mellon avatar
    53 posts
    Member since:
    May 2005

    Posted 23 Nov 2010 Link to this post

    I've installed the latest internal build of the controls to fix an issue with the RadbusyIndicator, but have noticed a problem with the RadButton.  I have 2 modal windows which have a cancel button which is a RadButton.  I've not made any changes to these 2 screens apart from updating to the internal build dll, now the cancel buttons are disabled, below is my declaration:

    I'm current using the following build:   2010.3.1119.1040

     

     


     

    <telerik:RadButton Content="Cancel"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"                                               
            telerik:Theming.Theme="Windows7"
            Command="telerik:WindowCommands.Close" 
            Margin="5" Padding="10,5" />

  2. Craig Mellon
    Craig Mellon avatar
    53 posts
    Member since:
    May 2005

    Posted 23 Nov 2010 Link to this post

    I have set IsEnabled to true in the XAML but when i run the project the button is still disabled. 

    I have another button on the screen which sets the IsEnabled property with databinding and this button works correctly as below:

    <telerik:RadButton Content="Add Note"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            telerik:Theming.Theme="Windows7" Margin="5" Padding="10,5"
            IsEnabled="{Binding NewNote.IsValid}" Name="RadButton1" />


    But this code does not work:
    <telerik:RadButton Content="Cancel"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"                                               
            telerik:Theming.Theme="Windows7"
            IsEnabled="True"
            Command="telerik:WindowCommands.Close" 
            Margin="5" Padding="10,5" />
  3. DevCraft banner
  4. Craig Mellon
    Craig Mellon avatar
    53 posts
    Member since:
    May 2005

    Posted 23 Nov 2010 Link to this post

    The problem seems to be with the CommandBinding, if I remove the command binding the button is enabled.

    I have checked the window declaration and the CanClose property was set to false (this was set to hide the close button).  It seems that with the latest version the WindowCommand.Close command is using this to enable/disable the button.

    My issue is now resolved so please ignore this post.

  5. Charles
    Charles avatar
    11 posts
    Member since:
    Mar 2013

    Posted 19 Mar 2013 Link to this post

    Thanks, that really helped me out!
Back to Top