Hello,
I have a template column in my XamGrid with a SumSummaryOperand that has the IsApplied property set to true.
My project uses MVVM and when the ItemsSource of the XamGrid is set to null, the IsApplied property of the SumSummaryOperand gets (undesireably) set to false. So, when the ItemsSource is set back to a collection, the summary is not displayed.
I put together a sample app to demonstrate. If you click the bind button, it runs a command that sets the ItemsSource to null, then to a new collection. The first time the button is clicked, you will see the summary. All subsequent times the button is clicked, the summary row will be blank.
If you comment out line 45 of TheViewModel.cs, then try the same test, you will see that the summary is never blank because IsApplied remains true.
Before running the app, please copy the following assemblies to the Libraries folder (they did not fit within the 200kb upload limit): InfragisticsSL4.v10.3.dll and InfragisticsSL4.Controls.Grids.XamGrid.v10.3.dll.
Does anyone know of a workaround for this issue? In the larger app that this issue affects, it is not as simple as ensuring that the ItemsSource is never set to null. One thought was to programmatically set IsApplied back to true whenever the ItemsSource changes, but there doesn't seem to be such an event to handle.
Thanks.
This was resolved in latest service release which was released at the end of September. The build number is 2115. It will also be included in the upcoming release.
Sincerely,
Valerie
Developer Support Engineer
Infragistics
www.infragistics.com/support
Could you please confirm exactly which release(s) this fix is included in? Will the fix be included in the upcoming Nov 8th 2011 release?
I am seeing this or at least a similar issue in my version (v11.1, June 2011).
Sorry for my hasty posting. The problem is resolved after upgrading my solution using version utility.
Thanks a lot!
I found the service lease you mentioned, 'NetAdvantage_SilverlightAndDV_20111.2115_SR', and installed it. But the fix is not applied yet. Is there any problem in my source code? Please review my previos post. Thanks a lot.
Thanks for your reply. I downloaded NetAdvantage 2011 vol.1 at 9, Jun, 2011,
but I found that the date of release you recomended is 7, Jun, 2011.
I think the release is not applied with the fix.
Here are my codes :
<UserControl ...>
<UserControl.Resources>
<Style x:Key="SumColumnStyle" TargetType="ig:CellControl"> <Setter Property="BorderBrush" Value="{StaticResource CellItemNormalBorderBrush}"/> <Setter Property="BorderThickness" Value="0,0,1,0"/> <Setter Property="FontSize" Value="12" /> <Setter Property="Foreground" Value="White" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ig:CellControl"> <Grid> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="CommonStates"> <vsm:VisualState x:Name="Normal" /> <vsm:VisualState x:Name="MouseOver"/> <vsm:VisualState x:Name="Alternate"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="AltElem" Storyboard.TargetProperty="(UIElement.Visibility)"> <DiscreteObjectKeyFrame KeyTime="00:00:00"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> </vsm:VisualState> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="SelectedStates"> <vsm:VisualState x:Name="Selected"/> <vsm:VisualState x:Name="NotSelected" /> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="ActiveStates"> <vsm:VisualState x:Name="Active"/> <vsm:VisualState x:Name="InActive"/> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="FixedStates"> <vsm:VisualState x:Name="Fixed"/> <vsm:VisualState x:Name="Unfixed"/> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="EditingStates"> <vsm:VisualState x:Name="Editing"/> <vsm:VisualState x:Name="NotEditing"/> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" x:Name="Root"/> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource CellItemAltNormalBackgroundBrush}" Visibility="Collapsed" x:Name="AltElem"/> <Rectangle Margin="0,0,1,0"> <Rectangle.Fill> <LinearGradientBrush StartPoint="0.194,0.277" EndPoint="0.933,0.277"> <LinearGradientBrush.GradientStops> <GradientStopCollection> <GradientStop Offset="0" Color="#FF53A6D4"/> <GradientStop Offset="0.944" Color="#FF53A6D4"/> </GradientStopCollection> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> <Rectangle Fill="#0C333333" Height="1" VerticalAlignment="Bottom" Margin="0,0,1,0"/> <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
<util:SummaryResultFormatStringValueConverter x:Key="SummaryResultFormatStringValueConverter" /> <Style x:Key="CustomSummaryCellStyle" TargetType="igPrim:SummaryRowCellControl"> <Setter Property="FontSize" Value="12" /> <Setter Property="SummaryDisplayTemplate"> <Setter.Value> <DataTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <TextBlock Text="{Binding Converter={StaticResource SummaryResultFormatStringValueConverter}}" /> </StackPanel> </DataTemplate> </Setter.Value> </Setter> </Style>
</ResourceDictionary> </UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
<ig:XamGrid x:Name="xGrid" Width="Auto" Height="Auto" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Top"> <ig:XamGrid.SummaryRowSettings> <ig:SummaryRowSettings AllowSummaryRow="Top" SummaryScope="ColumnLayout" Style="{StaticResource CustomSummaryCellStyle}" /> </ig:XamGrid.SummaryRowSettings> <ig:XamGrid.Columns> <ig:TextColumn Key="Y1_M01" FormatString="{}{0:N0}" HorizontalContentAlignment="Right" Width="96" HeaderTextHorizontalAlignment="Center" HeaderTextVerticalAlignment="Center" IsSummable="True" > <ig:TextColumn.SummaryColumnSettings> <ig:SummaryColumnSettings> <ig:SummaryColumnSettings.SummaryOperands> <ig:SumSummaryOperand IsApplied="True" /> </ig:SummaryColumnSettings.SummaryOperands> </ig:SummaryColumnSettings> </ig:TextColumn.SummaryColumnSettings> </ig:TextColumn>
</ig:XamGrid.Columns> </ig:XamGrid> </Grid></UserControl>
and This is "converter" source.
public class SummaryResultFormatStringValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Infragistics.SummaryResult result = (Infragistics.SummaryResult)value; return string.Format("{0:N0}", result.Value); }
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }