RadPageViewPage Disabled Style

2 posts, 1 answers
  1. Paul B
    Paul B avatar
    15 posts
    Member since:
    May 2013

    Posted 09 Jun 2015 Link to this post

    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

  2. Answer
    Dess
    Admin
    Dess avatar
    1601 posts

    Posted 10 Jun 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top