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

RadGridView not refreshing after ItemsSource changes.

5 Answers 592 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rajani
Top achievements
Rank 1
Rajani asked on 02 Apr 2013, 10:41 PM
I have a RadGridView where the ItemsSource is a DataTable. The user is able to run a query which returns a List of objects which I convert to a DataTable using a WPF Converter .. All the binding is done through XAML.. Everything works very well so far. If the user reruns the query RadGridView gets correctly updated as expected.

Now the problem is when I add grouping. Rerun the query and now the grid is empty. However if I remove the grouping, all the expected data is displayed on the grid and now if I regroup everything works fine until the ItemsSource on the grid is changed again (by re-running the query). Any idea why this is happening?

I tried removing the GroupingDescriptors and re-adding them .. Also tried rebinding when the ItemsSource changed .. both options did not work. What am I missing here?

Thanks.

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 03 Apr 2013, 07:57 AM
Hello,

Have you tried to set the ItemsSource to be the DataTable.DefaultView? 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rajani
Top achievements
Rank 1
answered on 04 Apr 2013, 06:05 AM
Thank you Didie for your prompt response.

Yes, I just tried DataTable.DefaultView but that did not help.. Here is the thing, every time I get data back from the server I'm recreating the DataTable  using a converter. Could that be the problem? Converter returns a DataTable (also tried returning DataTable.DefaultView)  ..

XAML looks like below:

<telerik:RadGridView.ItemsSource>

<MultiBinding Converter="{StaticResource CollectionToDataTableConverter}" >

<Binding Path="UIItems" Mode="TwoWay" />

<Binding Path="Fields" Mode="TwoWay" />

</MultiBinding>

</telerik:RadGridView.ItemsSource>

I also tried adding an event handler on ItemsSource_Changed and within it removed the groupDescriptor and adding it back .. that also did not help.

0
Dimitrina
Telerik team
answered on 04 Apr 2013, 08:29 AM
Hello,

Recreating the DataTable while you have some Grouping applied should not be a problem for the Items to be refreshed. Would it be possible for you to replicate the issue in a simple demo project? You could then open a support thread and send us the solution to check it locally.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rajani
Top achievements
Rank 1
answered on 05 Apr 2013, 05:45 AM
Hi Didie, I have created a quick and dirty demo project repro'ing this issue, however I'm not able to open a support ticket; it says that I'm not a licensed user.  Can you please tell me how I can send you the project? Thanks.
0
Dimitrina
Telerik team
answered on 05 Apr 2013, 07:58 AM
Hello,

You should be assigned as a licensed user in order to be able to open a support ticket. Please ask the licence holder to add you as such.

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Rajani
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Rajani
Top achievements
Rank 1
Share this question
or