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

Binding does not work in RadDataGrid

8 Answers 129 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pascal
Top achievements
Rank 1
Pascal asked on 24 Feb 2013, 12:45 PM

I have a data grid defined in XAML like this:

<telerikGrid:RadDataGrid AutoGenerateColumns="True" ItemsSource="{Binding Orders}"/>

 

The Orders property is a ReadOnlyObservableCollection which gets modified dynamically. Now there are two problems with this constellation:

  1. On initially loading the data is not populated until I modify the sorting in the column header.
  2. When I dynamically add an element to the collection, the view has problems with rendering. Again, when I change sorting in the column header, everything is fine again.

Is this a bug in the current release of the data grid?

EDIT:
As a workaround I can hook up to the collection changed event of the Orders collection and clear/add a sort descriptor in code behind like:

 

void PlanOrderTaskView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) {
      _ordersGrid.SortDescriptors.Clear();
      _ordersGrid.SortDescriptors.Add(new PropertySortDescriptor() { PropertyName = "Date" });
    }
 
    private void _ordersGrid_Loaded_1(object sender, RoutedEventArgs e) {
      PlanOrderTask vm = DataContext as PlanOrderTask;
      if (vm != null) {
        ((INotifyCollectionChanged)vm.Model.Orders).CollectionChanged += PlanOrderTaskView_CollectionChanged;
      }
    }

 

 

8 Answers, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 25 Feb 2013, 04:13 PM
Hello Pascal,

Thank you for your interest.

Indeed I must confirm that we have reproduced the erroneous behavior and it appears there is an issue with dynamically modifying the ItemsSource collection. I have logged this as a bug and it will be fixed in our next internal build. Meanwhile you can take advantage of the workaround you have found which is valid. Another workaround is to reset the ItemsSource after the collection is modified. I have also updated your Telerik points for your valuable feedback.

Sorry for the temporary inconvenience.

 

Greetings,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 2
answered on 28 Feb 2013, 09:28 AM
Hi,
i'm facing the same issue with the same workaround. Resetting the ItemsSource leads to an exception after a while (CancellationToken disposed). Can you estimate when the fix will be released?

Whatever - thank you for this great control!

Cheers, Alex
0
Ivaylo Gergov
Telerik team
answered on 28 Feb 2013, 01:48 PM
Hi Alexander,

We are targeting next week for the internal build but we cannot commit a specific date just yet.

I hope this information is useful.

 

All the best,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 2
answered on 28 Feb 2013, 03:24 PM
How can I download such an internal build? Through the control panel?
Thanks, kind regards
Alexander
0
Ivaylo Gergov
Telerik team
answered on 01 Mar 2013, 09:06 AM
Hi Alexander,

You can download it through your account from Manage Products -> Purchased Products & Extensions -> Then choose the purchased product -> Latest Internal Build and then choose RadControls for Windows 8.
I will let you know when the internal build is available(in this forum thread).

I hope this helps.

 

Greetings,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 2
answered on 01 Mar 2013, 09:08 AM
Thank you very much! Have a nice day.
0
Ivaylo Gergov
Telerik team
answered on 07 Mar 2013, 01:45 PM
Hi Alexander,

I am happy to inform you that our internal build which includes this fix is already available for download.

 

Kind regards,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 2
answered on 07 Mar 2013, 02:08 PM
Many thanks for this quick fix. Works great!!!
Tags
Grid for XAML
Asked by
Pascal
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Alexander
Top achievements
Rank 2
Share this question
or