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

change RadWindow background color programmably

3 Answers 393 Views
Window
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 10 Dec 2012, 06:33 PM
Can anyone tell me how to change RadWindow background and frame color programmably without using skin customization?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Dec 2012, 05:24 AM
Hi Allen,

One suggestion is that you can set different CssClass based on the condition. Here is the sample code that I tried to achieve your scenario.

CSS:
<style type="text/css">
    .preference .rwWindowContent
    {
        background-color: Green !important;
    }
    .availability .rwWindowContent
    {
        background-color: Yellow !important;
    }
</style>

C#:
protected void availability_Click(object sender, EventArgs e)
{
    RadWindow1.CssClass = "availability";
}
protected void preference_Click(object sender, EventArgs e)
{
    RadWindow1.CssClass = "preference";
}

Hope this helps.

Regards,
Princy.
0
Allen
Top achievements
Rank 1
answered on 11 Dec 2012, 03:04 PM
Can I also change the frame color programmably and how?  Please refer to the PNG.
0
Princy
Top achievements
Rank 2
answered on 12 Dec 2012, 04:13 AM
Hi Allen,

Try the following code snippet to achieve your scenario.

CSS:
<style type="text/css">
    .preference .rwTopLeft, .preference .rwTopRight, .preference .rwTitlebar, .preference .rwFooterLeft, .preference .rwFooterRight, .preference .rwFooterCenter, .preference .rwTopResize, .preference .rwStatusbar, .preference .rwBodyLeft, .preference .rwBodyRight
    {
        background-image: none !important;
        background-color: Green !important;
    }
    .availability .rwTopLeft, .availability .rwTopRight, .availability .rwTitlebar, .availability .rwFooterLeft, .availability .rwFooterRight, .availability .rwFooterCenter, .availability .rwTopResize, .availability .rwStatusbar, .availability .rwBodyLeft, .availability .rwBodyRight
    {
        background-image: none !important;
        background-color: Yellow !important;
    }
</style>

C#:
protected void availability_Click(object sender, EventArgs e)
{
    RadWindow1.CssClass = "availability";
}
protected void preference_Click(object sender, EventArgs e)
{
    RadWindow1.CssClass = "preference";
}

Hope this helps.

Regards,
Princy.
Tags
Window
Asked by
Allen
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Allen
Top achievements
Rank 1
Share this question
or