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

Can I change the color of the tab on RadPageView?

4 Answers 668 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 07 Nov 2016, 10:08 PM
I want to be able to distinguish between different tabs using color. How can I change the tabs to look something like this?

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 08 Nov 2016, 09:29 AM
Hi Pavel,

Thank you for writing.

The following snippet shows how to access the items and set their BackColor:
private void radButton1_Click(object sender, EventArgs e)
{
    RadPageViewStripElement stripElement = (RadPageViewStripElement)this.radPageView1.ViewElement;
    
    stripElement.Items[0].DrawFill = true;
    stripElement.Items[0].BackColor = Color.Red;
    stripElement.Items[0].GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Pavel
Top achievements
Rank 1
answered on 08 Nov 2016, 02:34 PM
This worked well, but only when the tab is active. When inactive, it's just showing up up a square and doesn't look good. Is there a way to make it look ok for the inactive tabs?
0
Accepted
Dimitar
Telerik team
answered on 09 Nov 2016, 07:55 AM
Hi Pavel,

You can show the border and set the shape as well:
RadPageViewStripElement stripElement = (RadPageViewStripElement)this.radPageView1.ViewElement;
stripElement.Items[0].DrawFill = true;
stripElement.Items[0].BackColor = ColorTranslator.FromHtml("#91c930") ;
stripElement.Items[0].GradientStyle = Telerik.WinControls.GradientStyles.Solid;
stripElement.Items[0].Shape = new RoundRectShape(6, true,false,true,false);
 
stripElement.Items[0].DrawBorder = true;
stripElement.Items[0].BorderColor = Color.DarkGray;
stripElement.Items[0].BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Pavel
Top achievements
Rank 1
answered on 09 Nov 2016, 03:36 PM
Thank you, that did the trick! I was on the right path with control spy, but somehow never managed to discover the properties that needed to be changed.
Tags
PageView
Asked by
Pavel
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Pavel
Top achievements
Rank 1
Share this question
or