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

How to handle datasource refresh ?

5 Answers 525 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 2
Veteran
Marco asked on 08 Oct 2015, 03:22 PM

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 ?

 

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 12 Oct 2015, 02:48 PM
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
0
Marco
Top achievements
Rank 2
Veteran
answered on 12 Oct 2015, 04:01 PM

Hi,

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

I will to switch to unbound mode tomorrow.

0
Hristo
Telerik team
answered on 13 Oct 2015, 10:06 AM
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
0
Marco
Top achievements
Rank 2
Veteran
answered on 04 Nov 2015, 04:58 PM

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

0
Hristo
Telerik team
answered on 05 Nov 2015, 01:57 PM
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
Tags
GridView
Asked by
Marco
Top achievements
Rank 2
Veteran
Answers by
Hristo
Telerik team
Marco
Top achievements
Rank 2
Veteran
Share this question
or