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

Overriding Radwindow CSS in code behind

1 Answer 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jesse
Top achievements
Rank 1
Jesse asked on 30 Mar 2020, 07:27 PM

Hi, is there a way to override the radwindow default styles in the code behind? For example for something like this:

 

    .RadWindow .rwStatusbar,
    .RadWindow_Default table .rwTopLeft,
    .RadWindow_Default table .rwTopRight,
    .RadWindow_Default table .rwFooterCenter,
    .RadWindow_Default table .rwFooterLeft,
    .RadWindow_Default table .rwFooterRight,
    .RadWindow_Default .rwCorner,
    .RadWindow_Default .rwBodyLeft,
    .RadWindow_Default .rwBodyRight {
        display: none !important;
    }

 

using something like this in the code behind instead

 

 

window.class.Add.Style(RadWindow .rwStatusbar, display:none)

 

...

Jesse

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 02 Apr 2020, 11:40 AM

Hi Jesse,

Тhe applied styles cannot be added form the server-side as the target elements (inside the RadWindow's table) are not accessible on the server. If you want to adding the provided styles only to a specific RadWindow, you can do it by adding a custom CSS class to the latter and cascade the CSS styles through it.

For example:

        RadWindow window = new RadWindow();
        window.VisibleOnPageLoad = true;
        window.CssClass = "customRadWindowClass";

        .customRadWindowClass .rwStatusbar,
        .customRadWindowClass table .rwTopLeft,
        .customRadWindowClass table .rwTopRight,
        .customRadWindowClass table .rwFooterCenter,
        .customRadWindowClass table .rwFooterLeft,
        .customRadWindowClass table .rwFooterRight,
        .customRadWindowClass .rwCorner,
        .customRadWindowClass .rwBodyLeft,
        .customRadWindowClass .rwBodyRight {
            display: none !important;
        }


Regards,
Vessy
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Jesse
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or