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

Group header and aggregates out of sync after collapse/expand

19 Answers 270 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Koren
Top achievements
Rank 1
Koren asked on 25 Apr 2012, 05:32 PM
Some of my users are seeing the group headers and aggregate functions get out of sync in a grid after expanding and collapsing a couple of times.  Groups will show the key and the details from that group but the aggregate results from another group.

This grid uses a group header template and the collapse all/ expand all functionality is in code using ExpandAllGroups() and CollapseAllGroups().  Is this a known issue?  (I am having trouble duplicating this on my machine but I have seen it happen on other machines)

Here is xaml for the grid:

<telerik:RadGridView DockPanel.Dock="Top" x:Name="grdAccrual" ItemsSource="{Binding EnterpriseAllocationRecords}" AutoGenerateColumns="False"
                                         IsFilteringAllowed="False" ShowGroupPanel="False" SelectionMode="Extended" ShowInsertRow="False" 
                                         ActionOnLostFocus="CommitEdit"  CanUserInsertRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
                                         IsReadOnly="False" CanUserFreezeColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False"
                                         RowIndicatorVisibility="Collapsed" AutoExpandGroups="True" EditTriggers="F2,CellClick"
                                         ScrollViewer.VerticalScrollBarVisibility="Auto" RowEditEnded="grdAccrual_RowEditEnded"
                                        RowHeight="27">
              
            <telerik:RadGridView.Columns>
                <!--<telerik:GridViewDataColumn Header="ATIG"  CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding TransactionCode}"  Width="65" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Description"  CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding TransactionDescription}" IsReadOnly="True" Width="*" />-->
                <telerik:GridViewDataColumn Header="Ent" CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding EnterpriseCode}" IsFilterable="False" IsReadOnly="True" Width="50" />
                <telerik:GridViewDataColumn Header="Ent Desc" CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding EnterpriseDescription}" IsFilterable="False" IsReadOnly="True" Width="350" />
                <telerik:GridViewDataColumn Header="Cash/Inv" DataMemberBinding="{Binding SuggestedAccrualAmount}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" >
                    <!--<telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Cash/Inv Accrual" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>-->
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="%" DataMemberBinding="{Binding AllocationPercent}" DataFormatString="{}{0:p2}" IsFilterable="False" Width="60">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>                            
                            <telerikInput:RadMaskedNumericInput x:Name="txtAllocationPercent" Mask="p3.2" 
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                                
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}"  
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="AllocationPercent" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:PercentValidationRule Min="-100.00" Max="100.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
  
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Units" DataMemberBinding="{Binding Units}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Weight" DataMemberBinding="{Binding Weight}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Amount}" DataFormatString="{}{0:f2}" IsFilterable="False" Width="70" >
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Amount" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerikInput:RadMaskedNumericInput x:Name="txtAmount" Mask="#11.2" 
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                                
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}"  
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="Amount" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:DoubleValidationRule Min="-10000000000.00" Max="10000000000.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
  
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.GroupRowStyle>
                <Style TargetType="telerik:GridViewGroupRow">
                    <Setter Property="ShowHeaderAggregates" Value="False"></Setter>                    
                </Style>
            </telerik:RadGridView.GroupRowStyle>
  
            <telerik:RadGridView.GroupHeaderTemplate>                
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="0,0" Height="45">
                        <TextBlock Text="{Binding Group.Key}" Margin="0,0,0,2" Width="200" />                        
                        <telerik:AggregateResultsList ItemsSource="{Binding AggregateResults}" VerticalAlignment="Center">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Caption}" Width="90" />
                                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding FormattedValue}" Width="90" Style="{StaticResource EnterpriseStatusStyle}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </telerik:AggregateResultsList>
                    </StackPanel>
  
                </DataTemplate>
            </telerik:RadGridView.GroupHeaderTemplate>
            <telerik:RadGridView.GroupDescriptors>
                <telerik:GroupDescriptor x:Name="TransactionGroup" Member="TransactionGroup" SortDirection="Ascending" >
                    <telerik:GroupDescriptor.AggregateFunctions>
                        <telerik:MinFunction Caption="Cash" SourceField="CashTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Beg Inv" SourceField="BegInvTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="End Inv" SourceField="EndInvTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Beg Acc" SourceField="BegAccruedTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="End Acc" SourceField="EndAccruedTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Accrual" SourceField="AccrualAmount" ResultFormatString="{}{0:c2}"  />
                        <telerik:SumFunction Caption="Ent Amt" SourceField="Amount" ResultFormatString="{}{0:c2}"  />
                        <local:EnterpriseDifferenceFunction Caption="Diff" ResultFormatString="{}{0:0.00}" />
                    </telerik:GroupDescriptor.AggregateFunctions>
                </telerik:GroupDescriptor>
            </telerik:RadGridView.GroupDescriptors>
        </telerik:RadGridView>

19 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 26 Apr 2012, 01:00 PM
Hello Koren,

I used the code snippet you provide in order to reproduce the issue but I was not able to. I'm attaching my test project for a reference. Can you modify it in order to demonstrate the issue?
 
Kind regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Koren
Top achievements
Rank 1
answered on 26 Apr 2012, 05:51 PM
I have not been able to duplicate the issue on my machine either but I saw it happen on a user's machine.  He sent me a screen print after the numbers got mixed up.  I am attaching three screen prints.  The first and second have the real data (you can see the Code and Accrual amounts).  The MixedUp screen print has the screen after a couple of expand all/collapse all actions (you can see now the Code and details are right but the Accrual amount is from another record altogether).  The Code comes from the group key.  The cash, inv, accrual amounts come from the aggregates list.

0
Yordanka
Telerik team
answered on 27 Apr 2012, 03:24 PM
Hello Koren,

The problem may come from the applied CellStyle and from this one - Style="{StaticResource EnterpriseStatusStyle}". In my test project I removed them because of missing resources. Can you modify the test project applying these styles and check whether the issue will appear? 
Also, what is the version of the Telerik controls you are using?
 
Greetings,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Koren
Top achievements
Rank 1
answered on 27 Apr 2012, 04:06 PM
We are using Q3 2011 (2011.3.1116.35).  Do I need to update?

The grid is in a user control within a tab control if that helps.
Here is the style from the UserControl Resources:
<Style x:Key="EnterpriseStatusStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource LabelFontColor}" />
            <Setter Property="FontWeight" Value="Normal" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Caption}" Value="Accrual">
                    <Setter Property="FontWeight" Value="Bold" />
                </DataTrigger>
                <DataTrigger Value="Equal">
                    <DataTrigger.Binding>
                        <MultiBinding Converter="{StaticResource EnterpriseStatusConverter}">
                            <Binding Path="Caption" />
                            <Binding Path="Value" />
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <Setter Property="Foreground" Value="{StaticResource GoodFontColor}" />
                </DataTrigger>
                <DataTrigger Value="GreaterThan">
                    <DataTrigger.Binding>
                        <MultiBinding Converter="{StaticResource EnterpriseStatusConverter}">
                            <Binding Path="Caption" />
                            <Binding Path="Value" />
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <Setter Property="Foreground" Value="{StaticResource WarningFontColor}" />
                </DataTrigger>
                <DataTrigger Value="LessThan">
                    <DataTrigger.Binding>
                        <MultiBinding Converter="{StaticResource EnterpriseStatusConverter}">
                            <Binding Path="Caption" />
                            <Binding Path="Value" />
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <Setter Property="Foreground" Value="{StaticResource ErrorFontColor}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

0
Yordanka
Telerik team
answered on 02 May 2012, 11:25 AM
Hello Koren,

Can you update the attached test project to use this style? Still, there are missing resources and I cannot reproduce the problem.
In order to attach the project you need to open a support ticket.
 
Regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Koren
Top achievements
Rank 1
answered on 09 Oct 2012, 09:28 PM
Sorry, I did not get back to this problem until today.  I commented out some of the pieces of the aggregate functions to remove the custom function and the custom style.  I am now duplicating this problem every time in my grid.  For testing purposes, I am displaying the Header Aggregates along with a GroupHeaderTemplate of Aggregate Results.  I am also displaying the cash total field in the grid so that I can verify the value. If you scroll all the way down and back up, it shows different results.  It also shows different results when you collapse and expand.  I cannot figure out what I am missing.
I included screen shots below.

Here is the xaml. 
<UserControl x:Class="AccrualView"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"            
    mc:Ignorable="d"                    
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"            
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    xmlns:telerikMaskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"                         
    xmlns:imKASHelper="clr-namespace:KMAR105.KAS.Controls;assembly=KASHelper"              
    xmlns:local="clr-namespace:KMAR105_Analysis_System" 
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    KeyboardNavigation.TabNavigation="Local"
    FocusManager.FocusedElement="{imKASHelper:FirstFocusedElement}">
    <UserControl.Resources>       
        <imKASHelper:EnterpriseStatusConverter x:Key="EnterpriseStatusConverter" />
 
        <sys:Double x:Key="LabelWidth">90</sys:Double>
 
        <local:CommandReference x:Key="ExpandAllCommandReference" Command="{Binding ExpandAllCommand}" />
        <local:CommandReference x:Key="CollapseAllCommandReference" Command="{Binding CollapseAllCommand}" />
        <!--<local:CommandReference x:Key="ExpandCurrentCommandReference" Command="{Binding ExpandCurrentCommand}" />
        <local:CommandReference x:Key="CollapseCurrentCommandReference" Command="{Binding CollapseCurrentCommand}" />-->
 
        <!--<Style x:Key="GridViewGroupRowHideAggregates" TargetType="telerik:GridViewGroupRow">
            <Setter Property="ShowHeaderAggregates" Value="False"/>
        </Style>-->
        <!--<Style x:Key="EnterpriseStatusStyle" TargetType="TextBlock">
            <Style.Triggers>
                <DataTrigger Binding="{Binding EntStatus}" Value="Good">
                    <Setter Property="Foreground" Value="{StaticResource GoodFontColor}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding EntStatus}" Value="Warning">
                    <Setter Property="Foreground" Value="{StaticResource WarningFontColor}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding EntStatus}" Value="Error">
                    <Setter Property="Foreground" Value="{StaticResource ErrorFontColor}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding EntStatus}" Value="None">
                    <Setter Property="Foreground" Value="{StaticResource TransparentFontColor}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>-->
        <Style x:Key="EnterpriseStatusStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource LabelFontColor}" />
            <Setter Property="FontWeight" Value="Normal" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Caption}" Value="Accrual">
                    <Setter Property="FontWeight" Value="Bold" />
                </DataTrigger>
                <DataTrigger Value="Equal">
                    <DataTrigger.Binding>
                        <MultiBinding Converter="{StaticResource EnterpriseStatusConverter}">
                            <Binding Path="Caption" />
                            <Binding Path="Value" />
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <Setter Property="Foreground" Value="{StaticResource GoodFontColor}" />
                </DataTrigger>
                <DataTrigger Value="GreaterThan">
                    <DataTrigger.Binding>
                        <MultiBinding Converter="{StaticResource EnterpriseStatusConverter}">
                            <Binding Path="Caption" />
                            <Binding Path="Value" />
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <Setter Property="Foreground" Value="{StaticResource WarningFontColor}" />
                </DataTrigger>
                <DataTrigger Value="LessThan">
                    <DataTrigger.Binding>
                        <MultiBinding Converter="{StaticResource EnterpriseStatusConverter}">
                            <Binding Path="Caption" />
                            <Binding Path="Value" />
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <Setter Property="Foreground" Value="{StaticResource ErrorFontColor}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>       
    </UserControl.Resources
    <UserControl.InputBindings>
        <KeyBinding Key="E" Modifiers="Alt" Command="{StaticResource ExpandAllCommandReference}" CommandParameter="You invoked the command with Alt + e" />
        <KeyBinding Key="L" Modifiers="Alt" Command="{StaticResource CollapseAllCommandReference}" CommandParameter="You invoked the command with Alt + l" />
        <!--<KeyBinding Key="E" Modifiers="Control" Command="{StaticResource ExpandCurrentCommandReference}" CommandParameter="You invoked the command with Ctrl + e" />
        <KeyBinding Key="L" Modifiers="Control" Command="{StaticResource CollapseCurrentCommandReference}" CommandParameter="You invoked the command with Ctrl + l" />-->
    </UserControl.InputBindings>
     
    <DockPanel LastChildFill="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <StackPanel
                DockPanel.Dock="Top"
                Margin="10,10,10,10"
                Height="23"
                Orientation="Horizontal"
                HorizontalAlignment="Right">
            <telerik:RadButton Margin="0,0,0,0" Width="100" x:Name="btnExpand" IsTabStop="False" Content="Expand All" ToolTip="Expand All (Alt+E)" Command="{StaticResource ExpandAllCommandReference}" />
            <telerik:RadButton Margin="0,0,0,0" Width="100" x:Name="btnCollapse" IsTabStop="False" Content="Collapse All" ToolTip="Collapse All (Alt+L)" Command="{StaticResource CollapseAllCommandReference}" />
        </StackPanel>
 
        <telerik:RadGridView DockPanel.Dock="Top" x:Name="grdAccrual" ItemsSource="{Binding EnterpriseAllocationRecords}" AutoGenerateColumns="False"
                                         IsFilteringAllowed="False" ShowGroupPanel="False" SelectionMode="Extended" ShowInsertRow="False"
                                         ActionOnLostFocus="CommitEdit"  CanUserInsertRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
                                         IsReadOnly="False" CanUserFreezeColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False"
                                         RowIndicatorVisibility="Collapsed" AutoExpandGroups="True" EditTriggers="F2,CellClick"
                                         ScrollViewer.VerticalScrollBarVisibility="Auto" RowEditEnded="grdAccrual_RowEditEnded"
                                        RowHeight="27">
             
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Ent" CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding EnterpriseCode}" IsFilterable="False" IsReadOnly="True" Width="50" />
                <telerik:GridViewDataColumn Header="Ent Desc" CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding EnterpriseDescription}" IsFilterable="False" IsReadOnly="True" Width="350" />
                <telerik:GridViewDataColumn Header="CashTot" DataMemberBinding="{Binding CashTotal}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" />
                <telerik:GridViewDataColumn Header="Cash/Inv" DataMemberBinding="{Binding SuggestedAccrualAmount}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" />
                <telerik:GridViewDataColumn Header="%" DataMemberBinding="{Binding AllocationPercent}" DataFormatString="{}{0:p2}" IsFilterable="False" Width="60">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerikInput:RadMaskedNumericInput x:Name="txtAllocationPercent" Mask="p3.2"  AcceptsReturn="False"
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                               
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}"
                                                                telerikMaskedInput:MaskedInputExtensions.Minimum="-2147483648"
                                                                telerikMaskedInput:MaskedInputExtensions.Maximum="2147483648"
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="AllocationPercent" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:PercentValidationRule Min="-100.00" Max="100.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
 
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Units" DataMemberBinding="{Binding Units}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Weight" DataMemberBinding="{Binding Weight}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Amount}" DataFormatString="{}{0:f2}" IsFilterable="False" Width="105" >
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Amount" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerikInput:RadMaskedNumericInput x:Name="txtAmount" Mask="#11.2"  AcceptsReturn="False"
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                               
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}" 
                                                                telerikMaskedInput:MaskedInputExtensions.Minimum="-2147483648"
                                                                telerikMaskedInput:MaskedInputExtensions.Maximum="2147483648"
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="Amount" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:DoubleValidationRule Min="-10000000000.00" Max="10000000000.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
 
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.GroupRowStyle>
                <Style TargetType="telerik:GridViewGroupRow">
                    <Setter Property="ShowHeaderAggregates" Value="True"></Setter>                   
                </Style>
            </telerik:RadGridView.GroupRowStyle>
 
            <telerik:RadGridView.GroupHeaderTemplate>               
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="0,0" Height="45">
                        <TextBlock Text="{Binding Group.Key}" Margin="0,0,0,2" Width="200" />                            
                        <telerik:AggregateResultsList ItemsSource="{Binding AggregateResults}" VerticalAlignment="Center">
                            <telerik:AggregateResultsList.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </telerik:AggregateResultsList.ItemsPanel>
                            <telerik:AggregateResultsList.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Caption}" Width="90" />
                                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding FormattedValue}" Width="90" />
                                        <!--<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding FormattedValue}" Width="90" Style="{StaticResource EnterpriseStatusStyle}" />-->
                                    </StackPanel>
                                </DataTemplate>
                            </telerik:AggregateResultsList.ItemTemplate>
                             
                        </telerik:AggregateResultsList>
                    </StackPanel>
 
                </DataTemplate>
            </telerik:RadGridView.GroupHeaderTemplate>
            <telerik:RadGridView.GroupDescriptors>
                <telerik:GroupDescriptor x:Name="TransactionGroupDescriptor" Member="TransactionGroup" SortDirection="Ascending" >
                    <telerik:GroupDescriptor.AggregateFunctions>                       
                        <telerik:MinFunction Caption="Cash" SourceField="CashTotal" ResultFormatString="{}{0:0.00}"  />
                        <!--<telerik:MinFunction Caption="Beg Inv" SourceField="BegInvTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="End Inv" SourceField="EndInvTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Beg Acc" SourceField="BegAccruedTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="End Acc" SourceField="EndAccruedTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Accrual" SourceField="AccrualAmount" ResultFormatString="{}{0:c2}"  />
                        <telerik:SumFunction Caption="Ent Amt" SourceField="Amount" ResultFormatString="{}{0:c2}"  />
                        <local:EnterpriseDifferenceFunction Caption="Diff" ResultFormatString="{}{0:0.00}" />-->
                    </telerik:GroupDescriptor.AggregateFunctions>
                </telerik:GroupDescriptor>
            </telerik:RadGridView.GroupDescriptors>
        </telerik:RadGridView>
 
    </DockPanel>
</UserControl>



0
Yordanka
Telerik team
answered on 12 Oct 2012, 03:11 PM
Hello Koren,

Thank you for the details.

I was able to reproduce the problem and logged it as a bug. We will investigate it further in order to provide a solution.

I've updated your Telerik points.
 
Kind regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Yordanka
Telerik team
answered on 19 Oct 2012, 11:01 AM
Hello Koren,

We debugged the problem and it was related to the applied GroupHeaderTemplate. We managed to resolve it and the fix for it is part of our just released Q3 2012 binaries. The only thing you should set is RadGridView.GroupRenderMode="Flat". It is a new mode which improves significantly the performance in grouped scenario. I am attaching a sample project for a reference. Please give it a try and let me know in case of any problems.
 
Greetings,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Koren
Top achievements
Rank 1
answered on 13 Nov 2012, 05:59 PM
It looks like the totals are fixed (on initial checking) when I use the GroupRenderMode=Flat.  However, now I have two sets of totals because it seems to be ignoring the ShowHeaderAggregates value of False.

<telerik:RadGridView.GroupRowStyle>
                <Style TargetType="telerik:GridViewGroupRow">
                    <Setter Property="ShowHeaderAggregates" Value="False"></Setter>                   
                </Style>
            </telerik:RadGridView.GroupRowStyle>

Do I need to set a different style to turn off the unwanted totals?

thank you!!!!
0
Yordanka
Telerik team
answered on 14 Nov 2012, 07:48 AM
Hello Koren,

When the GroupRenderMode is set to Flat you should apply implicit style that targets GroupHeaderRow instead of GridViewGroupRow: 

<Style TargetType="telerik:GroupHeaderRow">
            <Setter Property="ShowHeaderAggregates" Value="False" />
        </Style>

Let me know if you have additional questions.
 
Regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Koren
Top achievements
Rank 1
answered on 28 Nov 2012, 03:10 PM
Thank you.  My display appears to be correct now. 

However, a user did notice a problem with edit mode when the records are grouped this way (haven't seen it in other gridviews).  If you click or F2 to go into Edit mode and then hit enter to move down, it seems to go out of edit mode randomly.  You can move down a few rows without a problem (even across groups) and then it just switches to view mode when you hit enter so the focus is correct but you have to click to get back in to edit mode.  It may be related to scrolling because it seems to happen when I get close to the bottom of my screen.  Is this a known issue?
0
Yordanka
Telerik team
answered on 03 Dec 2012, 01:51 PM
Hello Koren,

Could you test with our latest internal build which will be available for download later today? Let me know in case the problem still occurs.
 
All the best,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Koren
Top achievements
Rank 1
answered on 11 Sep 2013, 06:01 PM
It took a long time to get back to this problem but yes, it still occurs in both 2013.1 and 2013.2 releases.  This is only a problem on the two grids that use grouping (without the group panel).  GroupRenderMode="Flat" on both these grids.

You can get into edit mode for a field and hit enter and it will commit and move to the next record correctly until it gets close to the bottom of the screen.  In that case, it commits and then goes into view mode on the next record.  To continue editing, the user has to click with the mouse or hit F2 again.

thanks!
0
Yordanka
Telerik team
answered on 12 Sep 2013, 01:25 PM
Hi Koren,

I've tried to reproduce the problem with grouped grid but to no avail. Could you check the attached test project?
 
Regards,
Yordanka
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Koren
Top achievements
Rank 1
answered on 13 Mar 2014, 02:31 PM
This issue reared its ugly head again.  I tried to duplicate the issue in the test project but can't get all the conditions right (grid in user control which is in tab etc.).  However, I tried on a whim to set my grid height to 500 to see what would happen.  This fixes the problem.  My current row as I get to the bottom of the grid now stays in sync and edit mode works.  I'm not thrilled about hard coding the height of the grid but I will do that for now.  Note: I had rowheight set to 27 for the older issue about viewing the bottom row but that did not fix this issue - it was Height.  Is there a known issue with the grid scrolling/selected row?  Anything I can do in my containers to avoid having to set the Height?

thanks!  Sorry this is taking so long to debug.
0
Koren
Top achievements
Rank 1
answered on 14 Mar 2014, 08:46 PM
After playing with this for hours and getting the same scroll issue no matter what, I just tried the demos and was able to duplicate the problem.

In the GridView EditTemplates Demo, I did the following:
1. Dragged Name into the Group Panel
2. Using the mouse, I clicked once in the name column just to get focus and selected row on the first record.
3. Used the down arrow key to navigate down the grid.  You will see in the picture that my focus moved over the header record but the selected record is one behind.  It doesn't happen every time but I was able to duplicate the problem at least three times.

In my application when I arrow down (or move down after edit), the focus goes down but not the selection.  This means that my record goes out of Edit mode and the user has to select the field again with the mouse or F2 to start editing again.  On my screen, it almost looks like the scroll isn't going all the way down.  If I use the right arrow, it moves the focus right and shifts up a tiny bit and then selects the record like it should.

Any ideas?

thanks!
0
Yordanka
Telerik team
answered on 17 Mar 2014, 02:12 PM
Hi Koren,

Thank you for the details.

The problem is known for us and it is logged in our tracking system. I will raise its priority in order to be investigated as soon as possible.

Regards,
Yordanka
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Koren
Top achievements
Rank 1
answered on 19 Feb 2015, 10:42 PM
Any workaround to this yet?  It makes data entry really difficult for my users when they have to check whether or not they are still in edit mode as they move down the grid.
0
Stefan
Telerik team
answered on 20 Feb 2015, 02:22 PM
Hello Koren,

I am afraid that we do not have any workarounds for this issue yet. You can track its progress in our Feedback Portal: Focus and selection desynchronize when navigating through the keyboard down key. You can also follow the feedback item. That way you will be notified each time the status of the item gets changed.

Best Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Koren
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Koren
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or