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

How to change the background of the RadWindow ?

13 Answers 595 Views
Window
This is a migrated thread and some comments may be shown as answers.
Suzi
Top achievements
Rank 1
Suzi asked on 10 Nov 2009, 04:59 PM
Hi, I would like to change the background of the radwindow. The background how hide all the page.

Is it possible and how ?

Thank you in advance,

Suzi.

13 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 11 Nov 2009, 10:11 AM
Hello Suzi,

The background property of RadWindow controls the background of the content of RadWindow. If I get it correct, you refer to the BorderBackground, since you are concerned with the visibility of controls behind RadWindow. To interactively see the effect of changing these properties you can take a look at our online Appearance example. To programmatically set a background to a transparent color use the following code-snippet:

this.Background = new SolidColorBrush(Colors.Transparent);

I hope this will resolve your issue. If this doesn't resolve your case, please get back to us as soon as possible, we will be eager to provide you with additional samples or suggestions.

Regards,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Suzi
Top achievements
Rank 1
answered on 12 Nov 2009, 08:34 AM
Thank you to try to help me. I am not speaking of the background of the content of RadWindow.
I am speaking about the modalBackground.
I don't see a modalBackground into the example of Silverlight you sent me. I changed a property named
ModalBackground = 'Black'. But the color doesn't change. It stays like blue.

Suzi.

0
Valeri Hristov
Telerik team
answered on 13 Nov 2009, 03:43 PM
Hello Suzi,

There seems to be a problem with the ModalBackground property. We will provide a fix in the internal build next Friday. I apologize for the inconvenience, your points have been updated.

Sincerely yours,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jennifer
Top achievements
Rank 1
answered on 16 Nov 2009, 07:07 PM
Hi,

Not sure if this is the same issue.  I use your radWindow as an alert like RadWindow.Alert(....)  and that gives me a modalDialog. I have another senario where I have a radWindow defined on a XAML page whose content is a UserControl - I am using this like a Child Window. How can I make this radWindow modal as well.

In addition,  I have a HTML Placeholder in this radWindow. When I drag the window, whatever is in it, stays behind in the old window location and may take 3 minutes to finally move to the new position. Any ideas?

Thanks
0
Jennifer
Top achievements
Rank 1
answered on 16 Nov 2009, 07:09 PM
One more question. My User Control in the radWindow has an "OK" button. How do I get that button to close the window?

Thanks
0
Miroslav Nedyalkov
Telerik team
answered on 18 Nov 2009, 01:13 PM
Hi Jennifer,

You can make a RadWindow show modal by using the ShowDialog method instead of the Show method.

About the problem with the HTMLPlaceholder if think the update takes too much time you could hide it when the user starts dragging or resizing the RadWindow control. For this task the RadWindow control provides the events LayoutUpdateStarted and LayoutUpdatedEnded. Please refer to the following example that demonstrates how to make a RadWindow control with a HTMLPlaceHolder in it and hides the HTMLPlaceHolder when the user start moving or resizing it:
UIElement content;
var wnd = new RadWindow { Header = "Window", Content = content = new RadHtmlPlaceholder { SourceUrl = new Uri("http://www.google.com", UriKind.Absolute) } };
wnd.LayoutChangeStarted += (s, e) =>
{
    content.Visibility = Visibility.Collapsed;
};
 
wnd.LayoutChangeEnded += (s, e) =>
{
    content.Visibility = Visibility.Visible;
};
 
wnd.ShowDialog();

You can close the RadWindow control by using its Close method. You can also make your OK button throws the WindowCommands.Close command like shown in the following XAML (this is the close button of the RadWindow control):
<Button x:Name="PART_CloseButton"
        Height="16" HorizontalAlignment="Right" Margin="0"
        VerticalAlignment="Top" HorizontalContentAlignment="Left"
        VerticalContentAlignment="Top"
         
    >
     
    <telerik:CommandManager.InputBindings>
        <telerik:InputBindingCollection>
            <telerik:MouseBinding Gesture="LeftClick"
                    Command="telerik:WindowCommands.Close" />
        </telerik:InputBindingCollection>
    </telerik:CommandManager.InputBindings>
     
    <Grid Width="11" HorizontalAlignment="Center" VerticalAlignment="Top"
            Margin="0,3,0,3">
         
    </Grid>
</Button>


Greetings,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jennifer
Top achievements
Rank 1
answered on 18 Nov 2009, 04:19 PM
Thanks - you have been a great help!
0
Alexey Pershin
Top achievements
Rank 1
answered on 13 Sep 2011, 03:55 PM
Hi.

Could you provide status of the issue? Is it solved today?
I can't set ModalBackground for the RadWindow.Confirm.

Thank you.
0
Boyan
Telerik team
answered on 16 Sep 2011, 03:55 PM
Hi Alexey Pershin,

This should be working fine with latest version. Here is the code you should use:
Copy Code
SolidColorBrush brush1 = new SolidColorBrush(Colors.Red);
var rect1 = new Rectangle() { Fill = brush1, Height = 20, Width = 20 };
DialogParameters dP = new DialogParameters()
{
    CancelButtonContent = "Cancel",
    DefaultPromptResultValue = "Test",
    Header = "Test",
    ModalBackground = brush1,
    OkButtonContent = "OK"              
};
RadWindow.Confirm(dP);

Let us know if you still have problems.

Kind regards,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Kevin
Top achievements
Rank 1
answered on 06 Dec 2011, 11:00 PM
I'm trying to use the DialogParameters to set the modal background and it is not having any effect.
           
var dialogParameters = new DialogParameters { ... ModalBackground = new SolidColorBrush { Color = Colors.Gray, Opacity = .3 } };

I have a MainWindow, with a modal RadWindow on top of that, and a RadWindow.Confirm window on top of that.  The RadWindow.Confirm is where I am using the code shown above.  No modal background shows on top of the middle-layer modal RadWindow.

Is there any particular reason you have a 'var rect1 = ...' in your code snippet?

Thank you
0
Boyan
Telerik team
answered on 09 Dec 2011, 03:14 PM
Hi Kevin,

The rectangle from the code snippet in my previous post has no purpose, I have just forgot it when I stripped the code from my project.

Could you please tell us which version of Telerik controls you are using as I tried a simple scenario per your directions and everything is working fine at my side with Q3 binaries. There is a greyish background when the first Modal Window is opened and then red background over both the opened window and the layout. I have attached the sample project I used. Could you check it and tell us if you are doing something else.

Regards,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Kevin
Top achievements
Rank 1
answered on 09 Dec 2011, 03:29 PM
Boyan,

When I navigate my way into these forums from Google, I tend to miss whether I'm in a Silverlight or WPF forum.  The indicator at the top of the forum is so small, and the Telerik code from Silverlight to WPF is so similar (a good thing), it gets confusing.  So it turns out I was looking for WPF help.

If this helps anyone else who accidentally stumbles on to this post, here is what I found on a different post:
The WPF version the DialogParameters.ModalBackground property is a dummy property.  It is there only for code/API compatibility with the Silverlight controls and doesn't actually have any effect on WPF.

If that is true, as a Telerik forum post says and as I experienced, I think it would be beneficial for Telerik to remedy this in a future version of the WPF controls.

Thank you for the help and sorry for the confusion.

Kevin Kalitowski
0
Boyan
Telerik team
answered on 14 Dec 2011, 10:51 AM
Hello Kevin Kalitowski,

Yes, this property is working only for Silverlight and is not applicable to WPF. We have tried to be consistent with the Windows look, so no modal background is available and also we have implemented the blinking feature of the modal window when the user click outside of it as in VS for example.

All the best,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Window
Asked by
Suzi
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
Suzi
Top achievements
Rank 1
Valeri Hristov
Telerik team
Jennifer
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Alexey Pershin
Top achievements
Rank 1
Boyan
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or