I want to set the color of the selected RadTabItem . I setted MaterialAssist.FocusBrush ,but it was not obvious. Can I set the selected color like radiobutton in RadTabItem ,cover all the area?
Thank you!
1 Answer, 1 is accepted
0
Vicky
Telerik team
answered on 31 May 2022, 12:23 PM
Hi Justin,
Thanks for the provided screenshots - they were of great help.
Setting the MaterialAssist.FocusBrush will take effect only for the SelectedVisual element of the RadTabItem, which by design, for the Material theme is represented by the following border:
You can either edit the default control template of the RadTabItem and modify it up to your requirements, or you can define a Style like the following to additionally change the background of the whole tab item area when the same is in its selected state:
<!--BasedOn is needed only for the NoXaml binaries--><StyleTargetType="telerik:RadTabItem"BasedOn="{StaticResource RadTabItemStyle}"><SetterProperty="mat:MaterialAssist.FocusBrush"Value="Red"/><Style.Triggers><TriggerProperty="IsSelected"Value="True"><!--You can also bind the value to the RadTabItem's MaterialAssist.FocusBrush to keep them in sync--><SetterProperty="Background"Value="Red"/></Trigger></Style.Triggers></Style>
I hope you find the above suggestions helpful.
Best Regards,
Vicky
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.