Hi Guys:
Fairly straightforward question. I'm using assembly 10.3 and wanting to add some group columns. Using both Blend 4 and VS2010 with the following code, I recieve the error message that follows the code snippet. It has to do with the way the layour and measuring routines work , however don't know what is causing the issue. Please advise.
Thanks
Steve
CODE:
/>
</
ig:XamGrid>
System.Reflection.TargetInvocationException
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
System.InvalidOperationException
An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.
at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs e) at Microsoft.Windows.Design.Platform.SilverlightViewProducer.SilverlightContentHost.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.ZoomableViewPresenter.DesignerBackground.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint) at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Interop.HwndSource.SetLayoutSize() at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) at System.Windows.Interop.HwndSource.set_RootVisual(Visual value) at MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)
System.NullReferenceException
Object reference not set to an instance of an object.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name) at MS.Internal.XcpImports.UIElement_UpdateLayout(UIElement element) at Microsoft.Windows.Design.Platform.SilverlightViewProducer.SilverlightContentHost.MeasureOverride(Size availableSize)
Hi,
I took your exact xaml, and tried it out, and it worked fine. Although i don't have your ItemsSource. Also, i had to remove the HeaderStyle that you set, b/c its not included.
Perhaps there is an issue with your headerStyle? What did you modify in it?
-SteveZ
yes when i removed the header style it working, why it is not working when i set the header style, what i need to include in the header styel to make it work
I have no idea. You didn't include your HeaderStyle so i don't know what you're doing in it.
If you can attach your Style, then I can take a look at it and see what's going on.
Hello,
This bug has been logged in our tracking system with an issue ID of 66524. I will be creating a private case to provide you with more information about this issue and so that you can track the status of the issue. You will also be notified once a fix is available.
Thanks for the sample.
Although next time, it might be better just include your txt file instead of pasting the xaml in the forums like that.
I was able to reproduce your issue, and it appears to be a bug where we apply the HeaderStyle assigned to the GroupColumn's Header as well,. This would normally be fine, however since the ControlTemplate is changing, the GroupColumn's Template is missing parts and it fails.
There are 2 easy workarounds for now.
1. used Implicit styling. Which means, that if you remove the key from the style, and don't set the HeaderStyle property, the Columns will automatically pick up those style changes.
2. Set the keyed style to each column.
NA
whats wrong with this cell, it works on normal header, when it is grouped this style does not work. Thanks.
<Style x:Key="GridHeaderStyle" TargetType
="igPrim:HeaderCellControl">
<Setter Property="FontSize" Value
="11" />
<Setter Property
="Background">
<Setter.Value
>
<LinearGradientBrush StartPoint="0,0" EndPoint
="0,1">
<LinearGradientBrush.GradientStops
<GradientStopCollection
<GradientStop Offset="0" Color
="#FF8d959a"/>
<GradientStop Offset="1" Color
="#FF6f858a"/>
</GradientStopCollection
</LinearGradientBrush.GradientStops
</LinearGradientBrush
</Setter.Value
</Setter
<Setter Property="Foreground" Value
="#FFFFFFFF"/>
<Setter Property="BorderBrush" Value
="#FFB3BDC0"/>
<Setter Property="BorderThickness" Value
="0,0,1,1"/>
<Setter Property="HorizontalContentAlignment" Value
="Left"/>
<Setter Property="Padding" Value
="8,4"/>
="Template">
<ControlTemplate TargetType
<igPrim:SimpleClickableContainer x:Name="NormalFill" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background
}">
<ig:Commanding.Commands
<ig:XamGridColumnCommandSource EventName="SimpleClick" CommandType
="Select"/>
="SortToggle"/>
</ig:Commanding.Commands
<VisualStateManager.VisualStateGroups
<VisualStateGroup x:Name
="CommonStates">
<VisualState x:Name
="Normal" />
="MouseOver">
<Storyboard
</VisualState
="Moving">
</VisualStateGroup
="FixedStates">
="Unfixed"/>
="Fixed"/>
="FixedIndicatorStates">
="NotFixable"/>
="Pinned">
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PinnedIndicator" Storyboard.TargetProperty
="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime
="00:00:00">
<DiscreteObjectKeyFrame.Value
<Visibility>Visible</Visibility
</DiscreteObjectKeyFrame.Value
</DiscreteObjectKeyFrame
</ObjectAnimationUsingKeyFrames
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FixedIndicator" Storyboard.TargetProperty
</Storyboard
="Unpinned">
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="UnpinnedIndicator" Storyboard.TargetProperty
="SortedStates">
="NotSorted"/>
="Ascending">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="SortedAscending" Storyboard.TargetProperty
="Opacity">
<SplineDoubleKeyFrame KeyTime="0" Value
="1"/>
</DoubleAnimationUsingKeyFrames
="Descending">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="SortedDescending" Storyboard.TargetProperty
="SelectedStates">
="NotSelected" />
="Selected"/>
="ActiveStates">
="InActive" />
="Active"/>
</VisualStateManager.VisualStateGroups
<Grid
<Grid.ColumnDefinitions
<ColumnDefinition Width
="Auto"/>
<!--<ColumnDefinition Width="Auto" ></ColumnDefinition>-->
<ColumnDefinition
="Auto" />
</Grid.ColumnDefinitions
<ContentPresenter Grid.Column="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" d:LayoutOverrides="Width" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding
}"/>
<Path x:Name="SortedDescending" Grid.Column="2" Data="M 0 0 L 4 4 L 8 0 Z" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Right" Opacity="0" Margin
="0,0,5,0"/>
<Path x:Name="SortedAscending" Grid.Column="2" Data="M0,4 L8,4 L4,0 z" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Right" Opacity="0" Margin
<Grid Grid.Column="3" Background="Transparent" Visibility="Collapsed" x:Name="FixedIndicator" Cursor="Hand" Margin
="0,0,5,0" >
<Grid x:Name="PinnedIndicator" Visibility="Collapsed" Background
="Transparent">
<ig:Commanding.Command
<ig:XamGridColumnCommandSource EventName="MouseLeftButtonDown" CommandType
="Unfix"/>
</ig:Commanding.Command
<
Path
Height
="10"
Width
="7"
Stretch
="Fill"
Opacity
="1"
Data
="M 6,4 C6,4 8,4 8,4 8,4 8,9 8,9 8,9 6,9 6,9 6,9 6,4 6,4 zM 5,3 C5,3 5,9 5,9 5,9 4,9 4,9 4,9 4,10 4,10 4,10 7,10 7,10 7,10 7,13 7,13 7,13 8,13 8,13 8,13 8,10 8,10 8,10 11,10 11,10 11,10 11,9 11,9 11,9 10,9 10,9 10,9 10,3 10,3 10,3 5,3 5,3 z"
Fill="{TemplateBinding Foreground}"
</Grid
<Grid x:Name="UnpinnedIndicator" Visibility="Collapsed" Background
="Fix"/>
="M 12,7 C12,7 12,9 12,9 12,9 7,9 7,9 7,9 7,7 7,7 7,7 12,7 12,7 zM 13,6 C13,6 7,6 7,6 7,6 7,5 7,5 7,5 6,5 6,5 6,5 6,8 6,8 6,8 3,8 3,8 3,8 3,9 3,9 3,9 6,9 6,9 6,9 6,12 6,12 6,12 7,12 7,12 7,12 7,11 7,11 7,11 13,11 13,11 13,11 13,6 13,6 z"
Fill="{TemplateBinding Foreground
}" />
</igPrim:SimpleClickableContainer
</ControlTemplate
</Style