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

Delete row during background thread changing grid

1 Answer 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 10 Oct 2011, 08:09 PM
Hi,

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,
George

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 13 Oct 2011, 02:09 PM
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. 

Regards,
Didie
the Telerik team

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

Tags
GridView
Asked by
George
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or