How to handle datasource refresh ?

6 posts, 0 answers
  1. Marco
    Marco avatar
    87 posts
    Member since:
    Apr 2011

    Posted 08 Oct 2015 Link to this post

    Hello Telerik,

     I need your expertise on a situation about one GridView.

    The gridview display a daily rows with a running value (3 column Date, Value, RunningValueOfValue). As it is a daily row with a few year of historical data there is a couple of thousand row in the datasource. As there is a running value, a change on one row should also update all following row.

    The datasource of the grid is a WCF Service. On CellValueChanged, I send the modification to the service which will return the new set of data (as an array) for all row (The calculation of the running value is made in the WCF Service). Then I have tested two options :

    1. I set the new array as the datasource of the grid. It is fast but the position of the grid is set back on top and I don't think my user will be happy about it.
    2. I use the new array to update each object in the actual binding source. It is very slow (more than 1 min) because the binding list raise a lot of event for updating the gridview (depending on the size). If I play with RaiseListChangedEvents and ResetBindings, it become fast again but the ResetBindings will have the effect as changing the datasource...

    What is the best way to handle this kind of situation ? Using an unbound datagridview ?

     

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 12 Oct 2015 Link to this post

    Hello Marco,

    Thank you for writing.

    If I understand correctly you are having a WCF which modifies the data in your grid every time a cell changes. In this type of setup perhaps it is indeed a good idea to have your RadGridView instance in unbound mode. 

    Please note that even if the grid is data bound and has several thousand entities, it should be able to refresh its view templates without a significant delay. In case, you decide to stay with this kind of setup you can try surrounding the update operation in begin and end update block:
    this.radGridView1.TableElement.BeginUpdate();
    //...
    this.radGridView1.TableElement.Endpdate();

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marco
    Marco avatar
    87 posts
    Member since:
    Apr 2011

    Posted 12 Oct 2015 in reply to Hristo Merdjanov Link to this post

    Hi,

    Looks like the TableElement.BeginUpdate/EndUpdate doesn't help much.

    I will to switch to unbound mode tomorrow.

  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 13 Oct 2015 Link to this post

    Hi Marco,

    Thank you for writing back.

    Please keep me updated on the progress of your project. 

    Looking forward to hearing from you.

    Regards,
    Hristo Merdjanov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Marco
    Marco avatar
    87 posts
    Member since:
    Apr 2011

    Posted 04 Nov 2015 Link to this post

    Hi,

    Come back after some day off !

    I have change the code to use the grid in unbound and it's going much faster.

    Juste have to play around handling the CellValueChanged because this event now fire when I update the grid and when the user update the value with the editor.

    I had also some performance issue with a Date column sort on first data feed. I don't know why, but the sort operation looks to be slow when there is a lot of empty cells. Just had to set the default sort after initial filling of the grid.

    I will now move on.

    Thanks for your support

  7. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 05 Nov 2015 Link to this post

    Hi Marco, 

    Thank you for writing back.

    I am glad that you have found a solution fitting your scenario. In case, you would like us to investigate the performance issue of the DateTime column in your old set up, please open up a support ticket and attach a sample project which we can test on our end.

    Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready