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.
XAML:
CodeBehind:
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)
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.
XAML:
<TelerikGrid:RadGridView Margin="8" ShowGroupPanel="False" AutoGenerateColumns="False" IsReadOnly="True" Controls:StyleManager.Theme="Vista" |
ItemsSource="{Binding LogisticData.LogisticsAssignments}"> |
<TelerikGrid:RadGridView.Columns> |
<TelerikGrid:GridViewDataColumn Header="Field Date" Width="200" DataMemberBinding="{Binding AssignmentDate}"/> |
</TelerikGrid:RadGridView.Columns> |
</TelerikGrid:RadGridView> |
CodeBehind:
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)