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

IsHierarchyRoot crash

2 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tal
Top achievements
Rank 1
Tal asked on 09 Feb 2009, 06:44 PM
Hi,
I get the following exception when I mark IsHierarchyRoot as "False".

   at Telerik.Windows.Controls.GridView.GridViewItemsControl.ExpandToAvailableSpace() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\GridViewItemsControl.cs:line 1329 
   at Telerik.Windows.Controls.GridView.GridViewItemsControl.GridViewItemsControl_Loaded(Object sender, RoutedEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\GridViewItemsControl.cs:line 852 
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) 
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) 
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) 
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) 
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent) 
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root) 
   at MS.Internal.LoadedOrUnloadedOperation.DoWork() 
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() 
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() 
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) 
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) 
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 
   at System.Threading.ExecutionContext.runTryCode(Object userData) 
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
   at System.Windows.Threading.DispatcherOperation.Invoke() 
   at System.Windows.Threading.Dispatcher.ProcessQueue() 
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) 
   at System.Windows.Threading.Dispatcher.Run() 
   at System.Windows.Application.RunDispatcher(Object ignore) 
   at System.Windows.Application.RunInternal(Window window) 
   at System.Windows.Application.Run(Window window) 
   at System.Windows.Application.Run() 
   at Imis.Kinetik.TeamPlayer.Client.App.Main() in C:\Projects\TeamPlayerClient\TeamPlayer.Client\obj\Development\App.g.cs:line 0 
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
   at System.Threading.ThreadHelper.ThreadStart() 

My define the grid like this (Info.Fields is a list):

<Telerik:RadGridView  MinHeight="200"   IsHierarchyRoot="False"  ShowGroupPanel="False" Grid.Row="7" Grid.ColumnSpan="2" Margin="5" AutoGenerateColumns="False" ItemsSource="{Binding Path=Info.Fields, ElementName=workunitNodeUC}" > 
            <Telerik:RadGridView.Columns> 
                <Telerik:GridViewDataColumn AutofitWidth="0" UniqueName="{x:Null}"
                    <Telerik:GridViewDataColumn.CellStyle> 
                        <Style TargetType="{x:Type Telerik:GridViewCell}"
                            <Setter Property="Template"
                                <Setter.Value> 
                                    <ControlTemplate  TargetType="{x:Type Telerik:GridViewCell}"
                                        <CheckBox x:Name="chbChosen" HorizontalAlignment="Center"/> 
                                    </ControlTemplate> 
                                </Setter.Value> 
                            </Setter> 
                        </Style> 
                    </Telerik:GridViewDataColumn.CellStyle> 
                </Telerik:GridViewDataColumn> 
                <Telerik:GridViewDataColumn AutofitWidth="0" HeaderText="Description" UniqueName="Description" DataMemberPath="Name" /> 
                <Telerik:GridViewDataColumn AutofitWidth="0" HeaderText="Comment" UniqueName="Comment" DataMemberPath="InnerValue"  /> 
            </Telerik:RadGridView.Columns> 
        </Telerik:RadGridView> 

Thanks

2 Answers, 1 is accepted

Sort by
0
Hristo Deshev
Telerik team
answered on 11 Feb 2009, 10:47 AM
Hello Tal,

IsHierarchyRoot is a property that is not meant to be set by API clients. We are trying to phase it out and the next release will contain only one or two places in the RadGridView *internal* code that will use it. We will also be improving the documentation, so that customers do not use it inadvertently.

Do you have a special need to set that property? RadGridView is always a hierarchy root and the only controls that are not hierarchy roots are nested child data controls when you have hierarchy defined.

Kind regards,
Hristo Deshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Tal
Top achievements
Rank 1
answered on 11 Feb 2009, 12:06 PM
No, it's OK. I don't have any need for it.
Just stumbled upon it during my feasibility checks and thought to let you know.
Tags
GridView
Asked by
Tal
Top achievements
Rank 1
Answers by
Hristo Deshev
Telerik team
Tal
Top achievements
Rank 1
Share this question
or