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

Telerik grid didn't show new data until refresh wpf

9 Answers 790 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi Avni
Top achievements
Rank 1
Avi Avni asked on 22 Jun 2010, 07:18 AM
when i add or deleted data from the grid the grid not refresh
until i go to other place like tab or page
can somebody no this problem ?.
best regard

9 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 22 Jun 2010, 08:41 AM
Hi Ehud Pinchas,

 Could you please describe your problem in a bit more detail? Do you change the data from code-behind?

Regards,
Yavor Georgiev
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
0
Avi Avni
Top achievements
Rank 1
answered on 22 Jun 2010, 08:57 AM

Hi Yavor,

Thanks for your help

I'm using tab control with tab item template the grid is part of this template

I have two buttons one for adding rows and one for delete rows

When I add or remove (in the code behind) the collection is changed

 But only after I clicking on some other page in the pager or on other tab the grid update

And  the user dont know what happend


Best regards

Ehud

0
Yavor Georgiev
Telerik team
answered on 22 Jun 2010, 09:21 AM
Hi Ehud Pinchas,

 What kind is your item collection? Is it an ObservableCollection?

All the best,
Yavor Georgiev
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
0
Avi Avni
Top achievements
Rank 1
answered on 22 Jun 2010, 09:33 AM
Hi Yavor ,

I don’t know what kind of collection I get

In the remove method I go to the RadGrid.Items.RemoveAt(index);

And in the add method I do this

((IList)RadGrid.ItemsSource).Insert(index, item);

 Its work fine usually but in the tab item template the grid not refresh

Like I say before


Best regards

Ehud
0
Accepted
Yavor Georgiev
Telerik team
answered on 22 Jun 2010, 09:36 AM
Hello Ehud Pinchas,

 The RadGridView can only detect a change in the backing collection if it implements INotifyCollectionChanged. If it doesn't, you should refresh the grid by calling Rebind() on it .

Kind regards,
Yavor Georgiev
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
0
Avi Avni
Top achievements
Rank 1
answered on 22 Jun 2010, 09:50 AM
it work thanks
best regards
Ehud
0
meir
Top achievements
Rank 1
answered on 25 Oct 2017, 11:45 AM
Hi, I'm having the same problem, all my collections are Observable Collections, and I still experience this problem, I update the collection in the code, and it doesn't update the Window until I click on the column header or restart the program...
0
meir
Top achievements
Rank 1
answered on 25 Oct 2017, 11:50 AM

I'm sorry, let me add more information, I already tried using items.Refresh() and Rebind(), both of them gave me an exception without any messages, was just saying that I'm in break mode and code was  in some external .

 

0
Stefan
Telerik team
answered on 30 Oct 2017, 09:39 AM
Hello Meir,

Thanks for the additional clarification.

Such behavior can be reproduced when the data is not edited from the user interface of the control, but programmatically. With such setup, you need to manually notify RadGridView for the modified data. The approach of achieving this is discussed in the Edit an item outside RadGridView help article. Can you please check it out and let me know how it goes?

Best Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Avi Avni
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Avi Avni
Top achievements
Rank 1
meir
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or