We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Datagridcontrol does not Display Data when Data is loaded with delay

Thread ID:





117936 Jan 11,2015 06:14 PM UTC Feb 6,2015 05:28 AM UTC WPF 6
Tags: GridTreeControl
Asked On January 11, 2015 06:14 PM UTC

I'm new to  the Syncfusion Framework (and also to the WPF at whole). I want to use the DataTreeControl to display a hierarchy of data which will be loaded and updated in a reoccuring interval. But for some reason it doesn't display the data.

Here's a snipped from my MainWindow.xaml

<syncfusion:TabItemExt Name="_tabItemTipps" Header="Tipps">                  
                        <syncfusion:GridTreeControl Name="_treeGrid"

                            <!--  Code for GridTreeControl Columns  -->
                                <syncfusion:GridTreeColumn  HeaderText="Nation" MappingName="{Binding RoughCat}"></syncfusion:GridTreeColumn>


This the snippet from MainWindow.xaml.cs where the DataContext is set:
  public MainWindow()
            DataContext = this;
            SkinStorage.SetVisualStyle(_tabControl, "Metro");
            _settingsVM = new AppSettingsVM();

            _txtBetdaqUser.DataContext = _settingsVM;
            _chkSystemActive.DataContext = _settingsVM;
            _chkInSimulationMode.DataContext = _settingsVM;

            _mechanic = new TippMechanic(_settingsVM);
            _soccerMarketsVM = new SoccerMarketVM();
            Task[] tasks = new Task[1];
            tasks[0] = Task.Factory.StartNew(async () => await _mechanic.Init());// _mechanic.Init();
            _soccerMarketsVM.SoccerMarkets = _mechanic.SoccerMarketManager.SoccerMarkets;
            _treeGrid.DataContext = _soccerMarketsVM.SoccerMarkets;

My ViewModel (_soccerMarketsVM) is defined  this way:
 class SoccerMarketVM : ObservableObject
        private ObservableCollection<SoccerMarket> _soccerMarkets;

        public ObservableCollection<SoccerMarket> SoccerMarkets
            get { return _soccerMarkets; }
                if(_soccerMarkets != null)
                    _soccerMarkets.CollectionChanged -= _soccerMarkets_CollectionChanged;
                _soccerMarkets = value;

                _soccerMarkets.CollectionChanged += _soccerMarkets_CollectionChanged;


        public SoccerMarketVM()
            //_soccerMarkets = new ObservableCollection<SoccerMarket>();
            //_soccerMarkets.CollectionChanged += _soccerMarkets_CollectionChanged;

        void _soccerMarkets_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

The Events for CollectionChanged are fired and I get the Console.Writeline output.
Does anyone see's something wrong here?

Jai Ganesh S [Syncfusion]
Replied On January 14, 2015 11:22 AM UTC

Hi SxTrader,

Thank you for using Syncfusion products.

We have analyzed your query. We have prepared a sample with Time delay to load the items and it can be downloaded from below location,

Sample Link:


Please let us know if you need further assistance.

Thank you,

Jai Ganesh S

Replied On January 14, 2015 01:57 PM UTC

Hello Jay Ganesh,
thank you for your support. Unfortunate your sample programm does not solve my problem.
The GUI of the sample is loaded when the time delayed data has finished loading. Actually if the data loading is pushed truely into background I face the same problem: The gui is displayed with an empty gridtreecontrol and the data isn't updated when the creation of the Model data has been finished by the background worker.

I've modified your sample and attached it this thread, so that you can see the issue.



Attachment: SelfRelational_Data_Binding_Demo_32e77799.zip

Replied On January 14, 2015 08:50 PM UTC

I've just figured how it works with asynchrones loading and update. I will update the sample application and post it here. So others who have the same issue can have a look.

Saranya CJ [Syncfusion]
Replied On January 23, 2015 04:28 AM UTC

Hi Markus,

Thank you for your update.
We will wait until you send us the sample application. Please let us know if you require any other assistance on this.


Replied On February 2, 2015 09:38 AM UTC

sorry for the delay. I had to do some things in my job first. You can find a working example attached to this post.
The problem seems to be that if the filling or updating of the ObservableCollection is done in background the presentation framework seems not to react on the events.
I've created a second Observable Collection. When the first one is filled or updated it fires an event which is caught by the ViewModel which compares the first Observable Collection with the second one and if neccessary adjust the second one.
It is not the best solution but a working one. A second step which I haven't done in the example project yet is to implement a NotificationObject Interface.

You can easily compare the two behaviours when you change the Binding in the XAML form PersonDetails2 back to PersonDetail or vice versa.

Attachment: SelfRelational_Data_Binding_Demo_357cc2cf.zip

Jai Ganesh S [Syncfusion]
Replied On February 6, 2015 05:28 AM UTC

Hi Markus,


Thank you for your update.


Please let us know if you require any other assistance.



Jai Ganesh S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon