updating the data source based on a value changed

2 posts, 0 answers
  1. Erion
    Erion avatar
    11 posts
    Member since:
    Feb 2011

    Posted 28 Sep 2011 Link to this post

    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. 

     |- 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 ? 
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 30 Sep 2011 Link to this post

    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
Back to Top