This is a migrated thread and some comments may be shown as answers.

Aggregate Row not showing

2 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chintan Shah
Top achievements
Rank 2
Chintan Shah asked on 05 Feb 2010, 08:30 AM
I have used two grid in second grid. I want to make sum of the Amount so i used SumFunction but is is not showingthe sum at the end and can you please provide a sample for binding to custom function. because Data is coming in a currency formated string.

<Page 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:Navigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
    xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    xmlns:sys="clr-namespace:System;assembly=mscorlib" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="RestaurantWave_Administrator_Console.Desktop.Views.Home" 
    Title="Home" mc:Ignorable="d"
    <Page.Resources> 
        <Storyboard x:Key="UpAnimationSB"
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="txtNewOrderCount" Storyboard.TargetProperty="(FrameworkElement.Height)"
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="20"/> 
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/> 
            </DoubleAnimationUsingKeyFrames> 
        </Storyboard> 
        <Storyboard x:Key="DownAnimationSB"
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="txtNewOrderCount" Storyboard.TargetProperty="(FrameworkElement.Height)"
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> 
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="21"/> 
            </DoubleAnimationUsingKeyFrames> 
        </Storyboard> 
    </Page.Resources> 
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="*" /> 
            <RowDefinition Height="470"/> 
            <RowDefinition Height="Auto"/> 
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
        </Grid.ColumnDefinitions> 
        <StackPanel Grid.Row="0"
            <UniformGrid x:Name="UniformGrid" HorizontalAlignment="Stretch"
                <StackPanel x:Name="stackPanel"
                    <TextBlock HorizontalAlignment="Center" x:Name="txtNewOrderCount" FontSize="16" Height="20"/> 
                    <telerik:RadButton x:Name="btnShowPanel" Height="21" Style="{DynamicResource DropDownButton}" RenderTransformOrigin="0.5,0.5" Margin="0.068,0,-0.068,0" Content="Show Orders"
                        <telerik:RadButton.RenderTransform> 
                            <TransformGroup> 
                                <ScaleTransform/> 
                                <SkewTransform AngleX="-7.765"/> 
                                <RotateTransform/> 
                                <TranslateTransform X="-1.364"/> 
                            </TransformGroup> 
                        </telerik:RadButton.RenderTransform> 
                    </telerik:RadButton> 
                </StackPanel> 
            </UniformGrid> 
        </StackPanel> 
        <telerik:RadGridView  
            Grid.Row="1"  
            AutoGenerateColumns="False" 
            CanUserDeleteRows="False"  
            CanUserReorderColumns="False"  
            EnableRowVirtualization="True"  
            IsReadOnly="True"  
            MultipleSelect="True"  
            RowDetailsVisibilityMode="Collapsed"         
            HorizontalAlignment="Stretch"                
            ItemsSource="{Binding OrdersCollections, Source={StaticResource orderWebService}}" 
            IsBusy="{Binding IsBusy, Source={StaticResource orderWebService}}" ScrollViewer.VerticalScrollBarVisibility="Auto" telerik:StyleManager.Theme="Office_Blue" Style="{DynamicResource RadGridViewStyle1}" Margin="0" d:LayoutOverrides="Height" MinHeight="0" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" UseAlternateRowStyle="True"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewSelectColumn/> 
                <telerik:GridViewToggleRowDetailsColumn/> 
                <telerik:GridViewDataColumn Width="150" Header="Order No" DataMemberBinding="{Binding OrderCode}" /> 
                <telerik:GridViewDataColumn Width="150" Header="Order Type" DataMemberBinding="{Binding OrderType}"/> 
                <telerik:GridViewDataColumn Width="150" Header="Order Amount" DataMemberBinding="{Binding OrderAmount}"/> 
                <telerik:GridViewDataColumn Width="200" Header="Placed Date/Time" DataMemberBinding="{Binding Order_Placed_Time}" DataFormatString="{}{0:dd,MMM,yy hh:mm tt}"/> 
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.RowDetailsTemplate> 
                <DataTemplate> 
                    <StackPanel Background="Black" HorizontalAlignment="Stretch"
                        <Navigation:RadTabControl Margin="30,30,30,30" x:Name="CustomerOrderDetail" HorizontalAlignment="Stretch" Height="261" Style="{DynamicResource RadTabControlStyle}" SelectedIndex="1"
                            <Navigation:RadTabItem Header="CustomerDetails" Margin="10,0,0,0" Height="24" FontSize="14.667"
                                <Grid Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding ConsumerDetail}"
                                    <Grid.RowDefinitions> 
                                        <RowDefinition Height="0*"/> 
                                        <RowDefinition Height="0.055*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.108*"/> 
                                        <RowDefinition Height="0.189*"/> 
                                    </Grid.RowDefinitions> 
                                    <Grid.ColumnDefinitions> 
                                        <ColumnDefinition Width="0*"/> 
                                        <ColumnDefinition Width="0.02*"/> 
                                        <ColumnDefinition Width="Auto"/> 
                                        <ColumnDefinition Width="0.025*"/> 
                                        <ColumnDefinition Width="0.692*"/> 
                                    </Grid.ColumnDefinitions> 
                                    <TextBlock Margin="0" VerticalAlignment="Stretch" Height="Auto" Text="Name :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="2" FontSize="18.667" Grid.RowSpan="1" HorizontalAlignment="Right"/> 
                                    <TextBlock HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="Phone :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="3"/> 
                                    <TextBlock HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="Street 1 :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="4"/> 
                                    <TextBlock HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="Street 2 :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="5"/> 
                                    <TextBlock HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="City :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="6"/> 
                                    <TextBlock HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="State :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="7"/> 
                                    <TextBlock HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="E-Mail :" TextWrapping="Wrap" Grid.Column="2" Grid.Row="8"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding ConsumerName}" Grid.Column="4" Grid.Row="2"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding ConsumerPhone}" Grid.Column="4" Grid.Row="3"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding Address_Street1}" Grid.Column="4" Grid.Row="4"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding Address_Street2}" Grid.Column="4" Grid.Row="5"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding Address_City}" Grid.Column="4" Grid.Row="6"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding Address_State}" Grid.Column="4" Grid.Row="7"/> 
                                    <TextBlock HorizontalAlignment="Left" Margin="0" VerticalAlignment="Stretch" FontSize="18.667" Text="{Binding ConsumerEmail}" Grid.Column="4" Grid.Row="8"/> 
                                    <Button Margin="-2.78,11.037,-4.748,8" Content="Print Order" Grid.Column="1" Grid.ColumnSpan="5" Grid.Row="9" d:LayoutOverrides="VerticalAlignment, GridBox" HorizontalAlignment="Center"/> 
                                </Grid> 
                            </Navigation:RadTabItem> 
                            <Navigation:RadTabItem Header="Ordered Item Details" Margin="0,0,0,0" Height="24"
                                <Grid Height="Auto" HorizontalAlignment="Stretch"
                                    <telerik:RadGridView x:Name="MenuItems" AutoGenerateColumns="False" ItemsSource="{Binding CurrentMenuItems}"
                                        <telerik:RadGridView.Columns> 
                                            <telerik:GridViewDataColumn Header="Serial No" DataMemberBinding="{Binding Path=SerialNumber}"
                                                <telerik:GridViewColumn.AggregateFunctions> 
                                                    <telerikData:SumFunction Caption="Hi:" SourceField="SerialNumber"  SourceFieldType="{x:Type sys:Int32}"></telerikData:SumFunction> 
                                                </telerik:GridViewColumn.AggregateFunctions>                                                 
                                            </telerik:GridViewDataColumn> 
                                            <telerik:GridViewDataColumn Header="Item Name" DataMemberBinding="{Binding Path=ItemName}"></telerik:GridViewDataColumn> 
                                            <telerik:GridViewDataColumn Header="Quantity" DataMemberBinding="{Binding Path=Quantity}"></telerik:GridViewDataColumn> 
                                            <telerik:GridViewDataColumn Header="Amount" DataMemberBinding="{Binding Amount}"
                                            </telerik:GridViewDataColumn> 
                                        </telerik:RadGridView.Columns> 
                                    </telerik:RadGridView> 
                                </Grid> 
                            </Navigation:RadTabItem> 
 
                        </Navigation:RadTabControl> 
                    </StackPanel> 
                </DataTemplate> 
            </telerik:RadGridView.RowDetailsTemplate> 
        </telerik:RadGridView> 
        <Grid Grid.Row="2" Height="20" Background="Black"
            <Grid.ColumnDefinitions> 
                <ColumnDefinition Width="0.995*"/> 
                <ColumnDefinition Width="0.005*"/> 
            </Grid.ColumnDefinitions> 
 
        </Grid> 
    </Grid> 
</Page> 
 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 05 Feb 2010, 08:51 AM
Hi,

You've missed to show column footers - you can check this demo to know more about various aggregates techniques:
http://demos.telerik.com/wpf/?GridView/Totals

All the best,
Vlad
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Chintan Shah
Top achievements
Rank 2
answered on 09 Feb 2010, 05:45 AM
Silly Question,

Thanks Very Much.
Tags
GridView
Asked by
Chintan Shah
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Chintan Shah
Top achievements
Rank 2
Share this question
or