I've upgraded to RadControls_for_Silverlight_3_2010_1_0422.
Now, if I try and group the grid by dragging a column header into the grouping block, I get the following error :
Line: 56
Error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.InvalidOperationException: MeasureOverride of element 'Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel' should not return PositiveInfinity or NaN as its DesiredSize.
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
This worked before the upgrade.
Kind Regards
Paul
5 Answers, 1 is accepted
Can you reproduce this on some of our online examples? Can you send us an example where we can reproduce this exception?
Kind regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
<ScrollViewer Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3">
<StackPanel>
<grid:RadGridView x:Name="RadGridView1" Loaded="RadGridView1_Loaded" telerik:StyleManager.Theme="Summer">
<grid:RadGridView.Columns>
<grid:GridViewToggleRowDetailsColumn />
<grid:GridViewDataColumn x:Name="dgcProductCode" Header="Registration Number" IsFilterable="True" DataMemberBinding="{Binding RegistrationNumber}">
<grid:GridViewDataColumn.AggregateFunctions>
<telerikData:CountFunction Caption="Vehicle Count: "/>
</grid:GridViewDataColumn.AggregateFunctions>
</grid:GridViewDataColumn>
<grid:GridViewDataColumn Header="Vehicle Description" IsFilterable="True" DataMemberBinding="{Binding VehicleDescription}" />
<grid:GridViewDataColumn Header="Odometer" IsFilterable="True" DataMemberBinding="{Binding Odometer}" />
<grid:GridViewDataColumn Header="Engine Number" IsFilterable="True" DataMemberBinding="{Binding EngineNumber}" />
<grid:GridViewDataColumn Header="Chassis Number" DataMemberBinding="{Binding ChassisNumber}" />
<grid:GridViewDataColumn Header="Division Description" DataMemberBinding="{Binding DivisionDescription}" />
<grid:GridViewDataColumn Header="Vehicle Model" DataMemberBinding="{Binding VehicleModel.VehicleModelDescription}" >
<grid:GridViewDataColumn.AggregateFunctions>
<telerikData:SumFunction Caption="Fuel Total: " SourceField="FuelIssueTotal"/>
<telerikData:SumFunction Caption="Workshop Total: " SourceField="JobCardTotal"/>
</grid:GridViewDataColumn.AggregateFunctions>
</grid:GridViewDataColumn>
</grid:RadGridView.Columns>
<grid:RadGridView.RowDetailsTemplate>
<DataTemplate>
<telerikNavigation:RadTabControl BackgroundVisibility="Collapsed" x:Name="RadTabControl1" Margin="10"
VerticalAlignment="Center" Background="Transparent" telerik:StyleManager.Theme="Summer" >
<telerikNavigation:RadTabItem Header="{Binding RegistrationNumber}" Background="Transparent" Height="24" telerik:StyleManager.Theme="Summer" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="3"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="3"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Border Background="Silver" Grid.Column="1"/>
<Border Background="Silver" Grid.Column="3"/>
<StackPanel Orientation="Vertical" Grid.Column="0">
<TextBlock Text="Vehicle Description: " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding VehicleDescription}" Margin="5,0,0,0"/>
<TextBlock Text="Odometer: " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding Odometer}" Margin="5" />
<TextBlock Text="Engine Number: " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding EngineNumber}" Margin="5" />
<TextBlock Text="Chassis Number: " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding ChassisNumber}" Margin="5" />
<TextBlock Text="Unit Division Description: " Margin="5" FontWeight="Bold" />
<TextBlock Text="{Binding DivisionDescription}" Margin="5"/>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2">
<TextBlock Text="Cost Per Hour (Rated): " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding VehicleModel.CPHRated}" Margin="5,0,0,0"/>
<TextBlock Text="Cost Per Hour (Target): " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding VehicleModel.CPHTarget}" Margin="5" />
<TextBlock Text="Cost Per Kilometer (Rated): " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding VehicleModel.CPKRated}" Margin="5" />
<TextBlock Text="Cost Per Kilometer (Target): " Margin="5" FontWeight="Bold"/>
<TextBlock Text="{Binding VehicleModel.CPKTarget}" Margin="5" />
<TextBlock Text="Litres Per 100 Km (Rated): " Margin="5" FontWeight="Bold" />
<TextBlock Text="{Binding VehicleModel.LPer100KmRated}" Margin="5"/>
<TextBlock Text="Litres Per 100 Km (Target): " Margin="5" FontWeight="Bold" />
<TextBlock Text="{Binding VehicleModel.LPer100KmTarget}" Margin="5"/>
<TextBlock Text="Fuel Consumption To Date: " Margin="5" FontWeight="Bold" />
<TextBlock Text="{Binding FuelConsumption}" Margin="5"/>
</StackPanel>
<Telerik_Windows_Controls:RadChart Grid.Column="4" Loaded="telPieStores_Loaded" ItemDataBound="telPieStores_ItemDataBound" ItemsSource="{Binding Entity.Sto_IssuedFuels}"/>
</Grid>
</telerikNavigation:RadTabItem>
<telerikNavigation:RadTabItem Header="Issued Fuel" Height="24" telerik:StyleManager.Theme="Summer" >
<Border BorderBrush="#FF848484" BorderThickness="0,1,0,0" Background="Transparent">
<grid:RadGridView Loaded="rgvFuel_Loaded" ItemsSource="{Binding Entity.Sto_IssuedFuels}" telerik:StyleManager.Theme="Summer"
x:Name="rgvFuelIssues">
<grid:RadGridView.Columns>
<grid:GridViewDataColumn Header="Sheet Number" DataMemberBinding="{Binding FuelDocument.SheetNumber}" />
<grid:GridViewDataColumn Header="Product" DataMemberBinding="{Binding Product.ProductCode}" />
<grid:GridViewDataColumn Header="Store" DataMemberBinding="{Binding Store.StoreDescription}" />
<grid:GridViewDataColumn Header="Quantity" DataMemberBinding="{Binding QtyIssued}" />
<grid:GridViewDataColumn Header="Odometer" DataMemberBinding="{Binding OdometerReading}" />
<grid:GridViewDataColumn Header="Fuel Pump" DataMemberBinding="{Binding FuelPump.PumpDescription}" />
<grid:GridViewDataColumn Header="Date" DataMemberBinding="{Binding IssueDate}"/>
<grid:GridViewDataColumn Header="Price Per Unit" DataMemberBinding="{Binding PricePerUnit}"/>
<grid:GridViewDataColumn Header="Total Price" DataMemberBinding="{Binding TotalPrice}">
<grid:GridViewDataColumn.AggregateFunctions>
<telerikData:SumFunction Caption="Order Total: " SourceField="TotalPrice"/>
</grid:GridViewDataColumn.AggregateFunctions>
</grid:GridViewDataColumn>
</grid:RadGridView.Columns>
</grid:RadGridView>
</Border>
</telerikNavigation:RadTabItem>
<telerikNavigation:RadTabItem Header="Jobcards" Height="24" telerik:StyleManager.Theme="Summer" >
<Border BorderBrush="#FF848484" BorderThickness="0,1,0,0" Background="Transparent">
<grid:RadGridView ItemsSource="{Binding Entity.Wks_Jobcards}" telerik:StyleManager.Theme="Summer"
x:Name="rgvJobcards" Loaded="rgvFuel_Loaded">
<grid:RadGridView.ChildTableDefinitions>
<grid:GridViewTableDefinition>
<grid:GridViewTableDefinition.Relation>
<telerikData:PropertyRelation ParentPropertyName="Wks_JobcardLines" />
</grid:GridViewTableDefinition.Relation>
</grid:GridViewTableDefinition>
</grid:RadGridView.ChildTableDefinitions>
<grid:RadGridView.Columns>
<grid:GridViewDataColumn Header="Jobcard Number" DataMemberBinding="{Binding JobcardNumber}" />
<grid:GridViewDataColumn Header="Odometer" DataMemberBinding="{Binding Odometer}" />
<grid:GridViewDataColumn Header="Total Price" DataMemberBinding="{Binding Total}">
<grid:GridViewDataColumn.AggregateFunctions>
<telerikData:SumFunction Caption="Order Total: " SourceField="Total"/>
</grid:GridViewDataColumn.AggregateFunctions>
</grid:GridViewDataColumn>
</grid:RadGridView.Columns>
</grid:RadGridView>
</Border>
</telerikNavigation:RadTabItem>
</telerikNavigation:RadTabControl>
</DataTemplate>
</grid:RadGridView.RowDetailsTemplate>
</grid:RadGridView>
<grid:RadDataPager x:Name="radDataPager1"
PageSize="10"
Source="{Binding Items, ElementName=RadGridView1}"
AutoEllipsisMode="None"
DisplayMode="All"/>
</StackPanel>
</ScrollViewer>
I only get this error if I navigate to a datapager tab other than the first tab and group it then.
RadGridView placed in StackPanel and/or ScrollViewer will be measured with infinity and in this case you will get serious problems with performance, etc. Why not use Grid instead?
Sincerely yours,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I am confused though, why was this working in the previous version?
I prefer working with stack panels, as it keeps the controls neat and close together easier than in a grid.
Is this a Silverlight or a Telerik issue?
Neither Silverlight nor Telerik is to blame. The problem with StackPanel is that it will measure all of its children with infinite height which renders our virtualization mechanism useless - and ultimately this manifests as poor performance and strange behavior.
All virtualization mechanisms rely on finite height/width to calculate how many UI containers should be created and if you get infinity there is no way perform this calculation.
Hope this clears the problem a bit.
Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.