We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Summary row cell's border

How can I add a border in a specific  summary row cell ( GridSummaryColumn)?

Thank you,

Constantin

7 Replies

AN Ashok N Syncfusion Team February 13, 2015 02:30 PM UTC

Hi Constantin,

Thank you for contacting Syncfusion support.

We have analyzed on your query and you can add a border in a specific  summary row cell by using SfDataGrid.GroupSummaryCellStyleSelector property. We have prepared a sample based on your requirement and attached in the below sample link, please refer it.

Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/SummaryRow-1385474788.zip

You can find the more details regarding StyleSelectors from the below UG documentation link

UG link: http://help.syncfusion.com/ug/wpf/default.htm#!Documents/styleselectors.htm

Please let us know if you require further assistance.
Thanks,
Ashok




GS George Sterg March 5, 2015 07:51 PM UTC

I have a similar issue.  I have a GridSummaryRow and i want for a specific GridSummaryColumn to show a different right border. I tried the above sample but the border is applied to the whole  summary row (colored right border at the end) .
I tried both TableSummaryCellStyleSelector  and TableSummaryCellStyle. I am attaching an image to see it (summary row: white background).
Thanks

George



Attachment: SummaryRow_b72a4d71.zip


GS George Sterg March 5, 2015 08:06 PM UTC

Also the SelectionUnit="Cell"  property in your example was giving me an error (had to removed it . ( probably the  Sfshared.wpf.dll? i had to import the shared.wpf.dll to run the example) 


GS George Sterg March 5, 2015 08:42 PM UTC

I think the Template Property in your style solves my problem. I have one more question: How can i manage the two VisualStates (LastCell,NormalCell) dynamically? i want to specify a number of SummaryCells with the "LastCell's" BorderThickness and the rest  SummaryCells  with the NormalCell's" BorderThickness, like the attached image. How can i use it?

Setter Property="Template">
<Setter.Value>
                    <ControlTemplate TargetType="{x:Type syncfusion:GridTableSummaryCell}">
                        <Border x:Name="PART_GridGroupSummaryCellBorder"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                SnapsToDevicePixels="True">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="BorderStates">
                                    <VisualState x:Name="LastCell">
                                        <Storyboard BeginTime="0">
                                            <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0" Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="PART_GridGroupSummaryCellBorder">
                                                <EasingThicknessKeyFrame KeyTime="0" Value="0,0,1,1"/>
                                            </ThicknessAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="NormalCell">
                                        <Storyboard BeginTime="0">
                                            <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0" Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="PART_GridGroupSummaryCellBorder">
                                                <EasingThicknessKeyFrame KeyTime="0" Value="0, 0, 3, 1"/>
                                            </ThicknessAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Content="{TemplateBinding Content}"
                                              ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="{TemplateBinding Margin}"
                                              SnapsToDevicePixels="True"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <!--Margin="{TemplateBinding Padding}"-->
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
 </Setter>


AN Ashok N Syncfusion Team March 9, 2015 08:52 AM UTC

Hi George,

Thank you for contacting Syncfusion Support.

Query 1: can set the different right border to GridSummaryColumn

We analyzed your query and you can set the different right border to GridSummaryColumn with help of StyleSelector.  We have prepared a sample by setting different right border to GridSummaryColumn by customizing GridTableSummaryCell. Please refer the following highlighted code snippet which shows how to set the right border thickness :

<Style x:Key=”GridGroupSummaryCellStyle1” TargetType=”{x:Type syncfusion:GridTableSummaryCell}”>

    <Setter Property=”Background” Value=”Transparent”/>

    <Setter Property=”BorderBrush” Value=”Green”/>

    <Setter Property=”Template”>

        <Setter.Value>

            <ControlTemplate TargetType=”{x:Type syncfusion:GridTableSummaryCell}”>

                    <VisualStateManager.VisualStateGroups>

                        <VisualStateGroup x:Name=”BorderStates”>

                            <VisualState x:Name=”LastCell”>

                                <Storyboard BeginTime=”0”>

                                    <ThicknessAnimationUsingKeyFrames BeginTime=”0” Duration=”1.0:0:0” Storyboard.TargetProperty=”BorderThickness” Storyboard.TargetName=”PART_GridGroupSummaryCellBorder”>

                                        <EasingThicknessKeyFrame KeyTime=”0” Value=”0,0,3,0”/>

                                    </ThicknessAnimationUsingKeyFrames>

                                </Storyboard>

                            </VisualState>

                            <VisualState x:Name=”NormalCell”>

                                <Storyboard BeginTime=”0”>

                                    <ThicknessAnimationUsingKeyFrames BeginTime=”0” Duration=”1.0:0:0” Storyboard.TargetProperty=”BorderThickness” Storyboard.TargetName=”PART_GridGroupSummaryCellBorder”>

                                        <EasingThicknessKeyFrame KeyTime=”0” Value=”0,0,3,0”/>

                                    </ThicknessAnimationUsingKeyFrames>

                                </Storyboard>

                            </VisualState>

                        </VisualStateGroup>

                    </VisualStateManager.VisualStateGroups>

            </ControlTemplate>

        </Setter.Value>

    </Setter>

</Style>

Sample link: http://www.syncfusion.com/downloads/support/directtrac/118224/SummaryRow313870424.zip

Query 2: SelectionUnit=”Cell” 

We have provide Cell selection support in 12.2. If you are using older product version, it throws the exception. Could you please upgrade your product version  to our current version  in order to get the fix for this issue?

Query 3:

We have analyzed your query but we unable to understand your requirement clearly. So could you please share more details regarding your query ? Please attach your requirement screenshot that would be more helpful for us to serve you.

Please let us know if you require further assistance,

Thanks,

Ashok




GS George Sterg March 9, 2015 05:45 PM UTC

Thank you, i use your code and added a new resource   <Thickness x:Key="ThickBorder" Left="0" Top="0" Right="3" Bottom="1"/>

and used it in the style <Setter Property="BorderThickness" Value="{DynamicResource SimpleBorder}"></Setter>. Now in code behind i can dynamically change the border! Thanks!


AN Ashok N Syncfusion Team March 10, 2015 04:46 PM UTC

Hi George

Thanks for your update. Please let us if you require further assistance on this.

Thanks,

Ashok.

Loader.
Live Chat Icon For mobile
Up arrow icon