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
290
XamData summary row and cell styles
posted

I have some difficulties with the summary in the xamdatagrid. What is the style for the row? Is it the  SummaryRecordPresenter?

My style is the above ( a two line border on top)

!--<Style TargetType="{x:Type igWPF:SummaryRecordPresenter}">
                    <Setter Property="Background" Value="{DynamicResource SummaryRowBackgroundBrush}"/>
                    <Setter Property="Foreground" Value="{DynamicResource summaryCellForegroundBrush}" />
                    <Setter Property="BorderBrush" Value="{DynamicResource summaryCellBorderBrush}"/>                                                          
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type igWPF:SummaryRecordPresenter}">
                                <Border Background="{TemplateBinding Background}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}"                                         
                                        Padding="{TemplateBinding Padding}">
                                    <Border Background="{TemplateBinding Background}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}"                                         
                                        Padding="{TemplateBinding Padding}"
                                            Margin="0,1,0,0">                                                                                                                 
                                    </Border>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>-->

The summary cell style is SummaryResultPresenter. I want to use two differrent right border thickness  like the one i have on the cells (see the image) how can i achive this?

(I use unbound fields to hold the fields, and the LabelPresenterStyle is either a style with thin right border or a style with thick  border if the field is the last one)

Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello George,

    Thank you for your post!

    You are correct that the SummaryRecordPresenter is the style for the full summary row, but to achieve your requirement, I would recommend styling the SummaryResultsPresenter for the cell-specific borders, and also that you implement the default style for the SummaryRecordContentArea. The default style for the SummaryRecordContentArea can commonly be found in the DataPresenterGeneric_Express.xaml file at the following directory: C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\DataPresenter.

    The reason that I would recommend implementing both of these styles is because the SummaryResultsPresenter style will only go into effect when a summary is applied to a particular field. If you write a style for this with border brush and border thickness setters, you can have a vertical border around the cells for your summaries for the fields that have summaries applied to them. The SummaryRecordContentArea represents the area where the content is, whereas the SummaryRecordPresenter would put a border at the very end of the summary row. In the default style for the SummaryRecordContentArea, there is a Border as the first element of its Template. If you give this border a border thickness and a border brush, you will see it appear around the summary area.

    I have attached a sample project to demonstrate the above.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XDGSummaryRecordStyleCase.zip
Children