Delete row during background thread changing grid

2 posts, 0 answers
  1. George
    George avatar
    6 posts
    Member since:
    May 2011

    Posted 10 Oct 2011 Link to this post


    I'm using a background worker to add or delete many rows from a grid view.  The background thread does the add or delete of each individual item from the backing collection on the Gui thread so as to avoid a cross thread exception.

    During the add or delete of hundreds or thousands of records, a user can insert a record into the GridView OK.  But when the user attempts to delete a record from the Gridview, the record does not appear to delete unless the user clicks on an editable field to invoke the editor, and then immediately clicks anywhere on another row in the Grid.  In this case the row disappears, as it should.

    I've tried using UpdateLayout() and Rebind() to no avail.  Is there some way I can do a refresh on the display of all visible rows to force the deleted row (it is definitely deleted from the backing collection) to disappear on the display. 

    Thanks in advance,

  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 13 Oct 2011 Link to this post

    Hello George,

     You will need to use Dispatcher.BeginInvoke for the operation in your background thread. It is needed in order to notify the Gui thread.

    I hope that this will help you. 

    the Telerik team

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

Back to Top