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
52
Problem with CellValuePresenter Template Foreground in combination with DataRecordCellArea
posted

Hi, I 'am having a bit of a trouble with "cellvaluepresenter"  foreground color. I have a DataRecordCellArea for Alternate background, i use it for opacity background, and it works fine. Becouse my background of USerControl  is black  and xamDatagrid is transparent  I want to  cellvalue presenter to have a white foreground  and when mouse over to turn black.  It works fine for simple case, but when I use Template for CellValue Presenter, becouse cells have a different fonts and propertis , it dont work. Here is my sample code:

 

  <Style TargetType="{x:Type igDP:DataRecordCellArea}">
                                                      
                                                        <Setter Property="BackgroundAlternate">
                                                            <Setter.Value>
                                                                <SolidColorBrush Opacity="0.3"  x:Name="animatedBrush" Color="LightGray" />
                                                            </Setter.Value>
                                                        </Setter>

                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource AncestorType={x:Type igDP:DataRecordCellArea}}}" Value="True">
                                                                <Setter Property="TextBlock.Foreground" Value="Black"/>
                                                            </DataTrigger>

                                                            <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource AncestorType={x:Type igDP:DataRecordCellArea}}}" Value="False">
                                                                <Setter Property="TextBlock.Foreground" Value="White"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>

 

 


 <Style x:Key="NazivCell" TargetType="{x:Type igDP:CellValuePresenter}">
                                                                       <Setter Property="Control.Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Label  Style="{TemplateBinding ForegroundStyle}"   Content="{Binding Path=DataItem.Naziv}" TextBlock.FontFamily="Calibri" TextBlock.FontSize="14" TextBlock.FontWeight="Bold"    TextBlock.TextAlignment="Left"/>
                                                                                                                                                 
                                                                    </StackPanel>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>

                                                    </Style>

 

I tried everithing , it works without a template in cellvalue presenter.

 

 

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello Antonio12345,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

     

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

Children
No Data