This is a migrated thread and some comments may be shown as answers.

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

1 Answer 158 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rohit
Top achievements
Rank 1
Rohit asked on 04 May 2009, 07:43 AM
Hello

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.

Regards
Rohit

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 06 May 2009, 01:09 PM
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,
Boyan
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.
Tags
Window
Asked by
Rohit
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or