Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > PageView > RadPageViewItem color

Not answered RadPageViewItem color

Feed from this thread
  • Eric avatar

    Posted on Dec 22, 2011 (permalink)

    I have a RadPageView (DetailTabControl).  I want to change the strip item's back color to red under some condition.  Then I might need to change it back.  I figured out how to change it to red.  Restoring the prior values does not restore the tab as I expected.  The back color (which I caught before setting to Red, ARGB(255, 191, 219, 255)) is for that of the PageView, not the PageViewPage.  Please see attached images.

    public class Globals
    {
    public static Color DefaultTabColor = Color.FromArgb(255, 191, 219, 255);
    }
    ...
    private void CancelTab(int offset)
    {
         DetailTabControl.Pages[offset].Item.DrawFill = true;
         DetailTabControl.Pages[offset].Item.NumberOfColors = 1;
         DetailTabControl.Pages[offset].Item.BackColor = Color.Red;   
    }
    private void UncancelTab(int offset)
    {
         DetailTabControl.Pages[offset].Item.BackColor = Globals.DefaultTabColor;
         DetailTabControl.Pages[offset].Item.NumberOfColors = 2;
         DetailTabControl.Pages[offset].Item.DrawFill = false;
    }

    Attached files

    Reply

  • Stefan Stefan admin's avatar

    Posted on Dec 27, 2011 (permalink)

    Hello Eric,

    Thank you for writing.

    You can reset the values of every RadObject to different states of their values by using the Reset method. In your case you need to reset them to Local settings. Here is how your UncancelTab method should look like:
    private void UncancelTab(int offset)
    {
        DetailTabControl.Pages[offset].Item.ResetValue(RadPageViewItem.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
        DetailTabControl.Pages[offset].Item.ResetValue(RadPageViewItem.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local);
        DetailTabControl.Pages[offset].Item.ResetValue(RadPageViewItem.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local);
    }

    I hope that the provided information addresses your question. Should you have any other questions, do not hesitate to contact us. 

    Greetings,
    Stefan
    the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > PageView > RadPageViewItem color