Catastrophic Failure: GridView Q3 sp3 against DomainDataSource.Data.ChildCollection

9 posts, 0 answers
  1. Corey Gaudin
    Corey Gaudin avatar
    57 posts
    Member since:
    Nov 2009

    Posted 25 Jan 2010 Link to this post

    Everytime I update my Telerik Controls to a later version to fix a set of issues it has, it always seems as if I have to fix tons of bugs that used to work with the previous version.

    In Q3 sp1 (1214) I used to be able to bind a GridView to a child collection of a RIA Service Object loaded by a DomainDataSource (created in code-behind). However, updating to sp2 (1314) appears to have broken this.

    Imagine if you will loading a single Customer (by adding a query parameter to pass the ID) using the Domain Data Source (which handles automatically making it a single item instead of a collection if only one item returns using its .Data property). Imagine now that you want a grid, in a Tab Control, to show the Orders of that Customer. This is one such example I am needing and worked fine in Q3 sp1, but not sp2 (1314).

    If I bind a GridView, in a TabControl to a Code-Behind DomainDataSource.Data's ChildCollection (which is of type  EntityCollection<ChildObject>) it crashes Silverlight with the StackTrace below this post. I need help as soon as possible, as my timelines are slipping. I cannot do anything different since I only want to load up the parent with its children together so I can add/edit its children and save changes with the DomainDataSource, and it saves everything will little effort. Loading up the children separate from the Parent would incur too much code changes, and would not be feasible. Besides, this used to work fine in the earlier version.

    <TelerikGrid:RadGridView Margin="8" ShowGroupPanel="False" AutoGenerateColumns="False" IsReadOnly="True" Controls:StyleManager.Theme="Vista" 
                                                         ItemsSource="{Binding LogisticData.LogisticsAssignments}"
                                        <TelerikGrid:GridViewDataColumn Header="Field Date" Width="200" DataMemberBinding="{Binding AssignmentDate}"/> 

    private LogisticsContext dataContext; 
    private DomainDataSource logisticDomainSource; 
    //... Instantiate the Domain Data Source and load up the RIA Query 
    //...   and set the QueryParameter of it to the ID of that item and return only one 
    public object LogisticData { 
                get { 
                    //return the loaded Logistic Item filtered to a single object, which 
                    // DomainDataSource makes a Single Item instead of a collection 
                    return logisticDomainSource.Data; 
    public bool HasChanges { 
                get { return !logisticDomainSource.CanLoad || logisticDomainSource.HasChanges; } 

    Error Message: GridViewDataControl_DuplicateDisplayIndex  
    StackTrace Error:
      at Telerik.Windows.Controls.GridViewColumnCollectionInternal.InitializeDisplayIndexMap()
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.get_DisplayIndexMap()
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.UpdateDisplayIndexForChangedColumn(Int32 oldDisplayIndex, Int32 newDisplayIndex)
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.OnColumnDisplayIndexChanged(GridViewColumn column, Int32 oldDisplayIndex, Int32 newDisplayIndex)
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.NotifyPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, NotificationTarget target)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.NotifyPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, NotificationTarget target)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e, NotificationTarget target)
       at Telerik.Windows.Controls.GridViewColumn.NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e, NotificationTarget target)
       at Telerik.Windows.Controls.GridViewColumn.DisplayIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.GridViewColumn.set_DisplayIndex(Int32 value)
       at Telerik.Windows.Controls.GridViewBoundColumnBase.ApplyItemPropertyInfoProperties()
       at Telerik.Windows.Controls.GridViewBoundColumnBase.InitializeItemPropertyInfo()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.InitializeItemPropertyInfos()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass44.<Bind>b__43()
       at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(Object newValue)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsSourceChanged(Object oldValue, Object newValue)
       at Telerik.Windows.Controls.DataControl.OnItemsSourcePropertyChanged(DependencyObject origin, DependencyPropertyChangedEventArgs args)
       at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
       at System.Windows.Data.BindingExpression.RefreshExpression()
       at System.Windows.Data.BindingExpression.SendDataToTarget()
       at System.Windows.Data.BindingExpression.SourcePropertyChanged(PropertyPathListener sender, PropertyPathChangedEventArgs args)
       at System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(PropertyPathStep source)
       at System.Windows.PropertyAccessPathStep.RaisePropertyPathStepChanged(PropertyListener source)
       at System.Windows.PropertyAccessPathStep.CurrentItemChanged(Object o, EventArgs e)
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Controls.Ria.DomainDataSourceView.OnCurrentChanged(EventArgs e)
       at System.Windows.Controls.Ria.DomainDataSourceView.OnCollectionViewCurrentChanged(Object sender, EventArgs e)
       at System.Windows.Data.EntityCollectionView.OnCurrentChanged()
       at System.Windows.Data.EntityCollectionView.MoveCurrentToPosition(Int32 position)
       at System.Windows.Data.EntityCollectionView.MoveCurrentToFirst()
       at System.Windows.Controls.Ria.DomainDataSourceView.MoveCurrentToFirst()
       at System.Windows.Controls.DomainDataSource.DomainContext_Loaded(LoadedDataEventArgs e, LoadContext loadContext)
       at System.Windows.Controls.DomainDataSource.LoadData_Callback(LoadOperation loadOperation)

  2. Corey Gaudin
    Corey Gaudin avatar
    57 posts
    Member since:
    Nov 2009

    Posted 27 Jan 2010 Link to this post

    Did anyone have a chance to look at this? Is there something I am missing? Something I can try? Is this a bug?

  3. Stefan Dobrev
    Stefan Dobrev avatar
    790 posts

    Posted 28 Jan 2010 Link to this post

    Hello Corey,

    It seems that issue is due to the fact that you have a DisplayAttribute with Order property on your Entity. We have recently fixed some issues with this order attribute not initialized correctly on sub-sequential changing of ItemsSource like in your case. This fix will be available in the next latest internal build, which will be published tomorrow - Friday. Can you please wait for it and verify the state of this issue when the build is available?

    Kind regards,
    Stefan Dobrev
    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.
  4. Corey Gaudin
    Corey Gaudin avatar
    57 posts
    Member since:
    Nov 2009

    Posted 29 Jan 2010 Link to this post

    Thank you Telerik,

    I will wait for the internal release Today to test it out, and let you know. Thank you for helping me fix this problem.
  5. Corey Gaudin
    Corey Gaudin avatar
    57 posts
    Member since:
    Nov 2009

    Posted 15 Feb 2010 Link to this post

    I have tested out Silverlight 3 2009_3_1412 Controls for the GridView and it still is crashing with the same problem. Is there any hope this will be fixed soon? It worked fine for 1214 build. Its giving the same exact error, and stacktrace, as well as the same problem above.
  6. Stefan Dobrev
    Stefan Dobrev avatar
    790 posts

    Posted 18 Feb 2010 Link to this post

    Hi Corey,

    It seems that you are hitting some corner case in your scenario. Can you please open a support ticket and attach your application there? This way we will be able to debug your scenario exactly and provide you with a solution.

    Best wishes,
    Stefan Dobrev
    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.
  7. Nagaraj
    Nagaraj avatar
    1 posts
    Member since:
    Aug 2011

    Posted 10 Oct 2011 Link to this post


    I have the same issue. I am using the version of "2011.2.920.1040". The following is my situation.

    I have RadTabControl with 4 tab pages. Each tab pages is having a RadGridView. The first tab is selected by default. When I navigate to second tab, the second RadGridView is getting loaded and I get the following exception.

    Message: Unhandled Error in Silverlight Application
    Code: 4004
    Category: ManagedRuntimeError
    Message: System.ArgumentException: GridViewDataControl_DuplicateDisplayIndex
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.InitializeDisplayIndexes()
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.get_DisplayIndexes()
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.ColumnFromDisplayIndex(Int32 displayIndex)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.InitializeMeasureData()
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

    Line: 455
    Char: 4
    Code: 0

    Please let me know in which version this issue fixed. I need this fix urgently.


  8. Yordanka
    Yordanka avatar
    634 posts

    Posted 11 Oct 2011 Link to this post

    Hi Nagaraj,

    I've tested the scenario you described but I cannot get the exception. Can you check my test project in the attached file? Is there something missing that may cause the problem?
    To verify whether the exception is fixed or not you may download our latest internal build - version 2011.2.1010.
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  9. Tilahun
    Tilahun avatar
    1 posts
    Member since:
    Sep 2014

    Posted 22 Sep 2014 in reply to Yordanka Link to this post

    I think you were give the same order property for data grid columns so trace it. from my experience your problem .... may be your Date column and other field has the same order property.
Back to Top