Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
inherited cell foreground
posted

Hello,

I was wondering how I can go about ensuring that certain properties of my grid inherit the value from the parent property. For example, I would like the color of the cells to be the same as that of the containing control. I've tried various things, like the xaml below whereby I am using data binding. Any ideas? Thanks

<UserControl x:Class="MyApp.UserControl1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

x:Name="_uc1" >

<Grid>

<Grid.Resources>

<Style TargetType="{x:Type igDP:CellValuePresenter}">

<Setter Property="ForegroundStyle">

<Setter.Value>

<Style>

<Setter Property="TextBlock.Foreground" Value="{Binding Path=Foreground, ElementName=_uc1}" />

</Style>

</Setter.Value>

</Setter>

</Style>

</Grid.Resources>

</Grid>

</UserControl>

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello giancarloa,

    Thank you for your post. I attached a sample showing the functionality you want. Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.

    If you have any further questions on this matter do not hesitate to ask.

    xamDataGridBinding.zip
Children
No Data