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
1325
Summary Cell background
posted

Hi. I want to have summary rows background white and only summary cells have some background (LightGray for example).

White background for summary row I set by:

<Style TargetType="idp:SummaryRecordPresenter">
      <Setter Property="Background" Value="White"/>
</Style>

But how I can set background color only for cells that have summaries?

I tried this style but there is no effect:

<Style TargetType="idp:SummaryCellPresenter">
      <Setter Property="Background" Value="LightGray"/>
</Style>

 I also tried this style:

<Style TargetType="idp:SummaryResultPresenter">
<Setter Property="Background" Value="LightGray"/>
</Style>

But not whole area is filled with background color:

I also want to have left and right borders of summary cell in the same color as summary row has.

  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post I suggest you use the following styles for the SummaryRecordPresenter and SummaryResultsPresenter in order to have the look you want. The trick here is that you have to set the Border that is in the SummaryResultsPresenter’s Template Background instead of its own Background.

     

    <Style TargetType="{x:Type igDP:SummaryRecordPresenter}">
        <Setter Property="Background" Value="White"/>
    </Style>
    <Style TargetType="{x:Type igDP:SummaryResultsPresenter}">
        <Style.Resources>
            <DataTemplate DataType="{x:Type igDP:SummaryResult}">
                <igDP:SummaryResultPresenter SummaryResult="{Binding}"/>
            </DataTemplate>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type igDP:SummaryResultsPresenter}">
                    <Border
    			Background="LightGray"
    			BorderBrush="{TemplateBinding BorderBrush}"
    			BorderThickness="{TemplateBinding BorderThickness}"
    			Padding="{TemplateBinding Padding}"
    			SnapsToDevicePixels="true">
                        <ItemsControl ItemsSource="{TemplateBinding SummaryResults}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel CanHorizontallyScroll="false" CanVerticallyScroll="false"/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </ItemsControl>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    

     

    Feel free to write me if you have further questions.