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

System.Exception: Catastrophic failure

2 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike Gorney
Top achievements
Rank 1
Mike Gorney asked on 15 Jan 2010, 07:01 PM
I have a grid column with the cell template below:
<telerikGridView:GridViewDataColumn.CellTemplate> 
                                                <DataTemplate> 
                                                    <StackPanel Orientation="Horizontal"
                                                        <Image Source="{Binding HostNameUrl}" Stretch="None"></Image> 
                                                        <TextBlock Text="{Binding HostName}"></TextBlock> 
                                                    </StackPanel> 
                                                </DataTemplate> 
                                            </telerikGridView:GridViewDataColumn.CellTemplate> 

The HostNameUrl for the Image is a URL to a local resource I set from a property like:
public string HostNameUrl 
get
string path = string.empty; 
 
switch(somevariable) 
case 1: 
return "Icons/FirstIcon.png"
case 2: 
return "Icons/SecondIcon.png"


This works perfect 99% of the time.  Occasionaly I get this exception upon calling GridView.Rebind():

System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) 
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr) 
   at MS.Internal.XcpImports.FrameworkElement_SetStyleValue(FrameworkElement doh, DependencyProperty property, PropertyInvalidationReason reason) 
   at System.Windows.DependencyObject.ClearValueInternal(DependencyProperty dp) 
   at System.Windows.DependencyObject.ClearValue(DependencyProperty dp) 
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.UnlinkContainerFromItem(DependencyObject container, Object item, Boolean isRecycled) 
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.UnlinkContainerFromItem(DependencyObject container, Object item) 
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.RemoveAll() 
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.OnRefresh() 
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) 
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args) 
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) 
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) 
   at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) 
   at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e) 
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) 
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) 
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) 
   at Telerik.Windows.Data.QueryableCollectionView.RefreshAndRaiseCollectionChanged(NotifyCollectionChangedEventArgs args) 
   at Telerik.Windows.Data.QueryableCollectionView.Refresh() 
   at Telerik.Windows.Controls.DataControl.Rebind() 
   at SightMaxSL.MainPage.EndInviteSessionToChat(Boolean success, UiVisitorSession session) 

what is strange, is that if i catch this exception, and immediately call Rebind(), it works and displays the proper image.  Any pointers on where I should be looking?

Edit: i should note that it is an ObservableCollection<T> that I am binding the grid to.



2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 19 Jan 2010, 01:02 PM
Hi Mike Gorney,

This seems like a bug in RadGridView but I am curious why you need to call Rebind. Rebind is usually used to refresh the grid when it is bound to non-observable collection. Could you please try to run your application without calling Rebind? If that is not possible I would like to ask you to send us your application so that we can try to isolate the problem. 


Regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mike Gorney
Top achievements
Rank 1
answered on 20 Jan 2010, 03:20 PM
I have to call Rebind() because the value of the property is determined by a another private variables state.  So the collection actually receives no notification that the value of the property has changed.
Tags
GridView
Asked by
Mike Gorney
Top achievements
Rank 1
Answers by
Milan
Telerik team
Mike Gorney
Top achievements
Rank 1
Share this question
or