Radwindow.Confirm prompt - size of CancelButton is large than the OKbutton

2 posts, 0 answers
  1. Rohit
    Rohit avatar
    12 posts
    Member since:
    Feb 2009

    Posted 04 May 2009 Link to this post


    I am using  RadWindow.Confirm, even if I specify the OkButtonContent as "Yes and CancelButtonContent as No, the size of the buttons remain unchangesd. Now "No" button is larger than the "Yes" button. How can I get rid of this. Please suggest.

  2. Boyan
    Boyan avatar
    758 posts

    Posted 06 May 2009 Link to this post

    Hi Rohit,

    The size of the buttons is fixed in the template. To change the size you need to edit the template and make your custom theme which you can attach to your confirm window. 

    Below I will explain in a few steps how this can be achieved:

    1. Add <telerikNavigation:RadConfirm/> to your xaml file, then right-click on the xaml file and choose "Open in Expression Blend " - to have this option in VS you need to install Expression Blend
    2. In the Blend studio find the RadConfirm window right-click on it and "Edit a Copy" . This will allow you to edit the Template. In the xaml, locate the lines shown below:
     <Button Height="25" Margin="5,5,5,5" Width="100" x:Name="OK" 
                            Style="{StaticResource System.Windows.Controls.Button}" Content="OK" /> 
                    <Button Height="25" Margin="0,5,5,5" Width="100" x:Name="Cancel" Foreground="CornflowerBlue" 
                            Style="{StaticResource System.Windows.Controls.Button}" Content="NO"/> 
    Please note that these are the changed buttons
    3. Change the Buttons as per your requirements, then save the changes
    4. In VS create a xaml file and add the Edited template as a ResourceDictionary
    5. Then, when you create your RadConfirm window in the code-behind just add the theme like this:
    RadWindow.Confirm(new DialogParameters() 
                    Header = "header"
                    Theme = new Theme(new Uri("/ChangeWindowConfirmTemplate;component/WindowTheme.xaml", UriKind.Relative))  

    6. That's it, you have customized the Confirm window.

    If you need more help, please feel free to ask.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top