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

Rebinding/refreshing GridView

2 Answers 523 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tchami
Top achievements
Rank 1
Tchami asked on 29 Jul 2008, 10:31 AM
Hi,

I'm getting my data for the GridView from an xml-document, and I'm binding it to the grid just as in the demo-application (in the GetXmlData() method).

However, I cannot seem to figure out how to rebind/refresh the grid programatically.

This is how I've done it so far:
radGridViewDataBinding.FilterDescription = null
radGridViewDataBinding.GroupDescriptions.Clear(); 
radGridViewDataBinding.SortDescriptions.Clear(); 
radGridViewDataBinding.Columns.Clear(); 
radGridViewDataBinding.AutoGenerateColumns = true
radGridViewDataBinding.ItemsSource = null
radGridViewDataBinding.ItemsSource = GetXmlData(); 

Absolutely nothing happens though. I'm sure I'm missing something obvious, but what?

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 29 Jul 2008, 01:32 PM
Hi Tchami,

In case you want to rebind to the same data source you can use the lightweight Rebind method of the RadGridView. The approach to first set the ItemSource to null and then set it to the original data source is also valid and it should be working.

Are you sure that the GetXmlData method returns the right data?

Kind regards,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rikin Patel
Top achievements
Rank 1
answered on 14 Feb 2010, 06:15 AM
thank u very much ............. thanks again......
Tags
GridView
Asked by
Tchami
Top achievements
Rank 1
Answers by
Milan
Telerik team
Rikin Patel
Top achievements
Rank 1
Share this question
or