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

Backcolor of Disabled RadPanel

1 Answer 168 Views
Panel
This is a migrated thread and some comments may be shown as answers.
Pavel Trnka
Top achievements
Rank 1
Pavel Trnka asked on 06 May 2010, 03:23 PM
Hi there,

very simple question, but i can't figure this out - where can I change the backcolor of RadPanel which is disabled? We are using the latest version of RadWinforms.

Thx so much

Pavel

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 11 May 2010, 04:27 PM
Hello Pavel Trnka,

In order to set the color of RadPanel when it is disabled, you need to set two properties:
1. The BackColor property to an appropriate value according to the Enabled state.
2. The UseDefaultDisabledPaint property should be set to false.

Please consider the following sample code snippet:

public Form1() 
    InitializeComponent(); 
    
    this.radPanel1.RootElement.UseDefaultDisabledPaint = false
    this.radPanel1.EnabledChanged += new EventHandler(radPanel1_EnabledChanged); 
    
void radPanel1_EnabledChanged(object sender, EventArgs e) 
    if (this.radPanel1.Enabled) 
    
        this.radPanel1.BackColor = Color.Transparent; 
    
    else
    
        this.radPanel1.BackColor = Color.Red; 
    
}

Generally, it is not necessary to set the UseDefaultDisabledPaint to false in this case the colors of the FillPrimitive contained in the RadPanel are Transparent. However, if the FillPrimitive of the RadPanel has a color, this property should be set, otherwise, you will get gray colors for the this primitive.

Greetings,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Panel
Asked by
Pavel Trnka
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or