Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataForm > Changing Background_Disabled color?

Answered Changing Background_Disabled color?

Feed from this thread
  • Jeff avatar

    Posted on Mar 22, 2012 (permalink)

    I'm trying to change the color of a RadDataForm, when it's disabled.

    I've found these instructions: http://www.telerik.com/help/wpf/raddatafor-styles-and-templates-styling-raddataform.html

    But when I load my solution file in Microsoft Expression Blend 4, I get exceptions:

    XamlParseException: 'Office_Black' is not a valid value for property 'Theme'.

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Mar 23, 2012 (permalink)

    Hi Jeff,

    I have tested such scenario with 2012.1 215, by extracting its template. I have not encountered neither design-time, nor run-time errors. Would you please confirm which version of RadControls you are currently using?

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Jeff avatar

    Posted on Mar 23, 2012 (permalink)

    I tried it in a simple test project, and had no troubles.  I'm not certain, at this time, what the problem is in my production project.

    Is there a way of just setting the Background_Disabled brush, without copying 100+ lines of style definition?  It's not just that I don't want to change any of it, I want to keep what's being defined on the higher level.

    In truth, I don't want to copy and edit the default style, I want to inherit from it and change just the one value I am interested in.

    I mean, if someone changes the application theme the default style will change, except for the controls that I've applied my copied style to.  And I don't want that.  I just want the Background_Disabled to be different, on a certain set of RadDataForms, regardless of what theme is set.

    Reply

  • Answer Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Mar 26, 2012 (permalink)

    Hi Jeff,

    Currently there are two options to achieve this. The first one is to predefine the template and the second one - to find the element in the visual tree at run-time and set its background property. That is how the framework works and unfortunately it is impossible for us to expose every single brush through a property, as this will severely damage our API's usability. However, with Q1 SP, we will introduce an implicit-style-based theming mechanism that would make the things easier in your scenario, because you would have direct access to the resources.

    All the best,
    Ivan Ivanov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Jeff avatar

    Posted on Mar 26, 2012 (permalink)

    This is working:
    foreach (Border border in myControl.ChildrenOfType<Border>())
    {
        if (border.Name == "Background_Disabled")
            border.Background = Brushes.Transparent;
    }
    Thanks.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataForm > Changing Background_Disabled color?