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

updating the data source based on a value changed

1 Answer 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erion
Top achievements
Rank 1
Erion asked on 28 Sep 2011, 10:33 PM
what is the recomanded way to do the following. 

On the gridview, when the user edits a cell value, I want to do some computations and assign a new data source to the gridview. I have tried to call refresh on the cell value changed, but that seams to cause a crash. 

So I have a hirachy of objects. 

Parent 
 |- Child One 
        | -> Child Two 

During the computation I am getting a new set of Child One objects. With this I mean new instances, which I want to rebind to the grid to show the effect of the edit. It seams that this is not accepted. I can understand that the grid might not expect it's datasource to have change on an cell value changed event, but how can I refresh assign a new data source to grid after an edit and show the changes back to the user ? 

1 Answer, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 30 Sep 2011, 05:41 AM
Hello Erion,

The easiest way to do this is with a timer, set to fire after 30ms or so after the value changed event to set another data source. This happens because of the asynchronous matter the grid handles data.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP
Tags
GridView
Asked by
Erion
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or