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.
Unfortunately, activation email could not send to your email. Please try again.

Summary row is not updating when i add/remove a new row

Thread ID:

Created:

Updated:

Platform:

Replies:

121588 Jan 5,2016 10:19 AM Jan 6,2016 10:56 PM WPF 3
loading
Tags: SfDataGrid
Mikhail
Asked On January 5, 2016 10:19 AM

My dataGrid has a ObservableCollection as data source.

When i add a new item into collection, the total values in summary row does not updated!
There is screenshot in attach file.


My sfDataGrid :
<syncfusion:SfDataGrid Grid.Row="1"
                               x:Name="MainSfDataGrid"
                               ItemsSource="{Binding Path=TemporaryCollection,Mode=TwoWay}"
                               AllowGrouping="False" AllowResizingColumns="True" AllowRowHoverHighlighting="True"
                               AllowSelectionOnPointerPressed="True"
                               BorderBrush="{DynamicResource LightBlueAccentBrush}" AutoGenerateColumns="False"
                               RowHoverHighlightingBrush="{StaticResource LightOverlayBlueAccentBrush}"
                               Background="Transparent"
                               SelectedItem="{Binding Path=SelectedItem,Mode=TwoWay}">
            <syncfusion:SfDataGrid.Resources>
                <Style TargetType="syncfusion:GridHeaderCellControl">
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="Background" Value="{DynamicResource LightBlueAccentBrush}" />
                </Style>
            </syncfusion:SfDataGrid.Resources>
            <syncfusion:SfDataGrid.Columns>
                <syncfusion:GridNumericColumn HeaderText="№" MappingName="RowNumber" NumberDecimalDigits="0"
                                              ColumnSizer="Auto" />
                <syncfusion:GridNumericColumn HeaderText="Article" MappingName="Article" NumberDecimalDigits="0"
                                              ColumnSizer="Auto" />
                <syncfusion:GridTextColumn HeaderText="Title" MappingName="Title" ColumnSizer="Star" />
                <syncfusion:GridTextColumn HeaderText="Description" MappingName="Description" ColumnSizer="Star" />
                <syncfusion:GridNumericColumn HeaderText="Quantity" MappingName="Quantity" NumberDecimalDigits="2"
                                              ColumnSizer="Auto" />
                <syncfusion:GridNumericColumn HeaderText="Price" MappingName="Price" NumberDecimalDigits="2"
                                              ColumnSizer="Auto" />
                <syncfusion:GridNumericColumn HeaderText="Summ" MappingName="Sum" NumberDecimalDigits="2"
                                              ColumnSizer="Auto" />
            </syncfusion:SfDataGrid.Columns>
            <syncfusion:SfDataGrid.TableSummaryRows>
                <syncfusion:GridTableSummaryRow  Title="Summary: {TotalSum} , {TotalQuantity} names." ShowSummaryInRow="True">
                    <syncfusion:GridTableSummaryRow.SummaryColumns>
                        <syncfusion:GridSummaryColumn Name="TotalSum"
                                                          Format="'{Sum:c}'"
                                                          MappingName="Sum"
                                                          SummaryType="DoubleAggregate" />
                        <syncfusion:GridSummaryColumn Name="TotalQuantity"
                                                          MappingName="RowNumber"
                                                          Format="'{Count:d}'"
                                                          SummaryType="CountAggregate" />
                    </syncfusion:GridTableSummaryRow.SummaryColumns>
                </syncfusion:GridTableSummaryRow>
            </syncfusion:SfDataGrid.TableSummaryRows>
        </syncfusion:SfDataGrid>


Attachment: Screenshot_4_aacbd77a.rar

Sivakumar R [Syncfusion]
Replied On January 5, 2016 10:27 AM

Hi Mikhail,

Based on the code snippet provides, set SfDataGrid.LiveDataUpdateMode property value to AllowSummaryUpdate or AllowDataShaping.
http://help.syncfusion.com/wpf/sfdatagrid/data-manipulation

Please let us know if you have any questions.

Thanks,
Sivakumar

Mikhail
Replied On January 6, 2016 03:02 AM

Thanks for your advice, I set the property SfDataGrid.LiveDataUpdateMode to AllowSummaryUpdate , and now the summary row works correct!

Sowndaiyan Paulpandi [Syncfusion]
Replied On January 6, 2016 10:56 PM

Hi Mikhail,

Thanks for the update.


Please let us know if you need further assistance.
Regards,
Sowndaiyan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;