Delay when using EntityFrameworkDataSource

9 posts, 2 answers
  1. Joao Paulo Grassi
    Joao Paulo Grassi avatar
    98 posts
    Member since:
    Feb 2011

    Posted 14 Jun 2012 Link to this post

    Hello!

    In our WPF project, we have a UserControl with a RadGridView to display persons. We decided to use the EntityFrameworkDataSource because it is easy to implement and offers a lot of advantages.

    We implement the Entity Data Source and everything is working except one thing. When we click on the Menu to call the UserControl, a delay is occuring. the UserControl takes 5~10 seconds to appear, and when it appear the RadGridView is already loaded with the data.

    If i remove the lines of the DataSource, the UserControl loads fast with 2 seconds. The Gridview only has 20 itens, i'm afraid that when the data begins to grow this delay became worse, it will impact a lot for the client.

    Can you help me solving this? It is hard to explain with words, if you not understand the problem let me know and i try to make a video.

    Thanks!
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 15 Jun 2012 Link to this post

    Hi,

     I have tested how the GridView loads on our demo about EntityFrameworkDataSource. My observations are that the data was loaded quite fast on the demo.

    May I ask you to make some additional tests in order to isolate the possible reasons for such a delay. What is the result if you set the ItemsSource without using the EntityFrameworkDataSource? Does it load faster? Any other relevant information would be helpful as well. 

    Thank you for your cooperation.

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Joao Paulo Grassi
    Joao Paulo Grassi avatar
    98 posts
    Member since:
    Feb 2011

    Posted 15 Jun 2012 Link to this post

    Hi Didie,

    I follow your instructions, I set the ItemSource without the EntityFrameworkDataSource. It notice that it load a little bit faster but still take a seconds to the UserControl appear.

    I forget to say in the first post, We have a UserControl with RadTransitionControl that is the Container for all of the others UserControls, When a item on the menu is selected, we add the UserControl to the RadTransitionControl:
    public void Navigate(int codigoModulo)
            {
                try {
                    #region [ Pessoas ]
                    if (codigoModulo == ModulosConstantes.PESSOAS_PESSOAS)
                    {
                                                           //TrnConteudoSistema is the RadTransitionControl
                                                          //PessoasVisao is the UserControl that is taking long time to appear.
                        this.TrnConteudoSistema.Content = new ITS.Contatos.PessoasVisao();
                    }
                         }
                     catch(exception){}
                }

    The biggest problem is, We click on the menu, and the delay occurs even if I set the ItemsSource without the Entity DataSource. After 5 seconds the Animation occurs and the UserControls show with the data already loaded.

    I was wondering if is there a way to only call the Load() when the animation already happened and the UserControl is loaded.
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 20 Jun 2012 Link to this post

    Hello,

     Thank you for that additional information.

     We have tested the loading time when using RadTransitionControl as well but we were not able to notice any delays.

    Would it be possible for you to isolate the problem in a simlpe application so that we could further investigate it? You can follow the guidelines in this blog post how to isolate the problem in a sample project. 


    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Joao Paulo Grassi
    Joao Paulo Grassi avatar
    98 posts
    Member since:
    Feb 2011

    Posted 20 Jun 2012 Link to this post

    Hi Didie,

    Thanks for your help. I follow the blog post, and I manage to recreate the problem in a isolated sample project. I've created the sample project with the same "structure" of the original one, and I also recreate the database with the table that the EntityFrameWork uses.

    I will attach a script to create the Database and the table/View and the WPF project.

    Where do I attach the file? Here? Or should I open a support ticket?

    Thanks!
  7. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 20 Jun 2012 Link to this post

    Hello,

    It would be great if you send us the demo project in a support ticket. 

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Joao Paulo Grassi
    Joao Paulo Grassi avatar
    98 posts
    Member since:
    Feb 2011

    Posted 21 Jun 2012 Link to this post

    Hi Didie,

    I send the sample project in the Support ticket.

    Hope that helps.

    Thanks!
  9. Joao Paulo Grassi
    Joao Paulo Grassi avatar
    98 posts
    Member since:
    Feb 2011

    Posted 29 Jun 2012 Link to this post

    Hi Didie,

    Thank you for your support

    I'd like to say that I set the GridView DataLoadMode to Asynchronous and now the UserControl loads a faster than before.

    I just have one more question, the EntityFrameworkDataSource also have the IsBusy property like DataServiceDataSource?

    IsBusy="{Binding IsBusy, ElementName=PessoasDataSource}"
  10. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 02 Jul 2012 Link to this post

    Hi,

     The load of the EntityFrameworkDataSource is synchronous and it does not have an IsBusy property. 

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready