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

RadPageViewPage Disabled Style

1 Answer 191 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Paul B
Top achievements
Rank 2
Paul B asked on 09 Jun 2015, 05:15 PM

I am using the RadPageView and the Telerik Metro Blue theme. I have a case in my UI where there is only 1 tab displayed in the RadPageView. In that case I disable the singe RadPageViewPage so that it can't be clicked. When I do that the RadPageViewPage style is a white background with blue text. I would like to be able to set enabled to false but keep the RadPageViewPage style that it has when it is enabled (i.e. blue background and white text). I tried looking through the properties but I can't seem to find the right property to set. I was thinking something like myPageViewPage.MouseOverBackColor = myPageViewPage.BackColor or something like that.

 Any suggestions as to what properties control the MouseOverStyle of the RadPageViewPage and how I could set them to use the Enabled style?

Thanks!
~Paul

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Jun 2015, 12:19 PM
Hello Paul,

Thank you for writing.

TelerikMetroBlue theme has a specific style applied to the RadPageViewStripItem for the disabled state of the page. However, you can subscribe to the RadPageViewPage.EnabledChanged event and set the desired ForeColor and BackColor of the RadPageViewStripItem:
public Form1()
{
    InitializeComponent();
    this.radPageViewPage1.EnabledChanged+=radPageViewPage1_EnabledChanged;
}
 
private void radPageViewPage1_EnabledChanged(object sender, EventArgs e)
{
    if (this.radPageViewPage1.Enabled==false)
    {
        RadPageViewStripItem strip = this.radPageView1.ViewElement.Items.First()as RadPageViewStripItem ;
        strip.ForeColor= Color.White;
        strip.BackColor = Color.FromArgb(27, 161, 226);
        strip.DrawFill = true;
        strip.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
PageView
Asked by
Paul B
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or