简体   繁体   中英

Telerik RadPageView in BackStage mode: howto change selected item color without whole new theme?

I'm looking for a way to set the color of an item in a RadPageView (in backstage mode) at runtime. There are a lot of properties that you can reach via the designer and the "Edit UI elements" section, they work well and they can simply override any theme settings as they are "inline", if you want to put it like that. All I need is to change the background color of the selected item. Creating and applying a custom theme just for that seems a little over the top. Any ideas on how to set this property via code?

You can use the SelectedPageChanging event for this:

    void radPageView1_SelectedPageChanging(object sender, RadPageViewCancelEventArgs e)
    {
        e.Page.Item.BackColor = Color.Red;
        e.Page.Item.DrawFill = true;
        e.Page.Item.GradientStyle = GradientStyles.Solid;

        radPageView1.SelectedPage.Item.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        radPageView1.SelectedPage.Item.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
        radPageView1.SelectedPage.Item.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM