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

[Solved] Re-bind of GridView not happening

0 Answers 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bhaskar Khaund
Top achievements
Rank 1
Bhaskar Khaund asked on 22 Dec 2010, 11:22 AM
Hi,

I am creating a multi-heriarical grid and its heriarchy is given below:
Main RadGridView1
 -- Grid Row
    -- Rad Expander
    -- Tab Control
        -- Tab Item 1 (I have two tab items with the same hiriarchy)
            RadGridView2
            RadGridView3
            RadGridView4
            --Grid Row
            -- Rad Expander
            --Tab Control
                    Tab Item 1
                        RadGridView5
                        RadGridView6

Now, I want to refresh (re-bind) all the Grid that are children to the current row of the Main RadGrid when a data is changed (the data can be changed by double-cliking the Row, i.e. RowActivating event) from any of these chldrens.  For that on RowActivating of any row of the child grid, I am storing the instance of the RadExpanders/Tab Controls and once data is saved/updated I get the latest data as DataTable and rebind those child grids.

This is happening fine, but its not constant. That is, sometimes the re-bind doen't work and sometimes it does, it working intermittently. I debugged my code to confirm if I am getting the updated data, and even-though i get all my data corectly to the data table, it doesn't re-bind always. There is no specific pattern. The code I am using to rebind is:
DataTable data = <my new data>;
gridInstance.ItemsSource = data;
data.OnCollectionChanged(new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Reset));

As you can see,  I even tried explicitely firing the collection changed event, but didnt solved the issue.

Can you please help me with this? Let me know, I am not making myself clear in my explaining.

Regards,
Bhaskar
Tags
GridView
Asked by
Bhaskar Khaund
Top achievements
Rank 1
Share this question
or