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
65
Theme is overwrite my customized cell background (Bug?)
posted
 I want to use "Office2K7Blue" theme in the XamDataPresenter and also want to highlight row base on a cell value.  Here is my xaml code. But it doesn’t work together. If I remove the theme, the customize DataRecordCellArea style works fine. Is it a bug or I did it wrong?    <UserControl.Resources>                <Local:LineActionStatusConverter x:Key="lineActionStatusConverter" />         <Style TargetType="{x:Type igDP:DataRecordCellArea}">            <Style.Triggers>                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.LineTestStatus, Converter={StaticResource lineActionStatusConverter}}" Value="True">                    <Setter Property="Background" Value="Red" />                    <Setter Property="FontWeight" Value="Bold" />                </DataTrigger>            </Style.Triggers>        </Style>            </UserControl.Resources>                <igDP:XamDataPresenter x:Name="XamDataPresenter1" Margin="2,2,2,2" Theme="Office2K7Blue" DataSource="{Binding Path=CurrentBatch.TestResults}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AutoFit="False" GroupByAreaLocation="None">                    <igDP:CarouselView>                        <igDP:CarouselView.ViewSettings>                            <igWindows:CarouselViewSettings IsListContinuous="True" />                        </igDP:CarouselView.ViewSettings>                    </igDP:CarouselView>                     <igDP:XamDataPresenter.FieldSettings>                        <igDP:FieldSettings AllowEdit="False" />                    </igDP:XamDataPresenter.FieldSettings>                     <igDP:XamDataPresenter.FieldLayoutSettings>                        <igDP:FieldLayoutSettings AllowAddNew="False"                                                    AllowDelete="False"                                                    ScrollViewer.HorizontalScrollBarVisibility="Auto"                                                                  ScrollViewer.VerticalScrollBarVisibility="Auto"                                                                                                    SelectionTypeRecord="Single"                                                  SelectionTypeField="Single"                                                   HighlightAlternateRecords="True"                                                  DataRecordSizingMode="SizedToContentAndFixed" />                    </igDP:XamDataPresenter.FieldLayoutSettings>                </igDP:XamDataPresenter>Please help. Thank you very much! 

 

Parents
No Data
Reply
  • 1215
    posted

    Hi --

    You should be able to resolve your problem by moving your custom Style into the XamDataPresenter.Resources collection like so:

    <igDP:XamDataPresenter x:Name="XamDataPresenter1" Theme="Office2K7Blue">
        <igDP:XamDataPresenter.Resources>
             <Style TargetType="{x:Type igDP:DataRecordCellArea}">
                   <!-- Custom Style Here -->
             </Style>
        </igDP:XamDataPresenter.Resources>
    </igDP:XamDataPresenter>

    When you set the Theme property, behind the scenes Resources are being pumped in locally to the control's Resources collection, effectively overwriting your Style defined in UserControl.Resources. By moving your Style to the XamDataPresenter.Resources, your custom Style will overwrite the Styles included in the Theme.

    Hope this solves your problem!

Children