How to change the background of the RadWindow ?

14 posts, 0 answers
  1. Suzi
    Suzi avatar
    85 posts
    Member since:
    Mar 2008

    Posted 10 Nov 2009 Link to this post

    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.

  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 11 Nov 2009 Link to this post

    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.
  3. DevCraft banner
  4. Suzi
    Suzi avatar
    85 posts
    Member since:
    Mar 2008

    Posted 12 Nov 2009 Link to this post

    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.

  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 13 Nov 2009 Link to this post

    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.
  6. Jennifer
    Jennifer avatar
    16 posts
    Member since:
    Nov 2007

    Posted 16 Nov 2009 Link to this post

    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
  7. Jennifer
    Jennifer avatar
    16 posts
    Member since:
    Nov 2007

    Posted 16 Nov 2009 Link to this post

    One more question. My User Control in the radWindow has an "OK" button. How do I get that button to close the window?

    Thanks
  8. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 18 Nov 2009 Link to this post

    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.
  9. Jennifer
    Jennifer avatar
    16 posts
    Member since:
    Nov 2007

    Posted 18 Nov 2009 Link to this post

    Thanks - you have been a great help!
  10. Alexey Pershin
    Alexey Pershin avatar
    2 posts
    Member since:
    Dec 2009

    Posted 13 Sep 2011 Link to this post

    Hi.

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

    Thank you.
  11. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 16 Sep 2011 Link to this post

    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 >>

  12. Kevin
    Kevin avatar
    27 posts
    Member since:
    Aug 2012

    Posted 06 Dec 2011 Link to this post

    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
  13. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 09 Dec 2011 Link to this post

    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 >>

  14. Kevin
    Kevin avatar
    27 posts
    Member since:
    Aug 2012

    Posted 09 Dec 2011 Link to this post

    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
  15. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 14 Dec 2011 Link to this post

    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 >>

Back to Top
DevCraft banner