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

Updatind persistent objects

1 Answer 40 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anatol
Top achievements
Rank 1
Anatol asked on 22 Sep 2010, 11:12 AM
Hi,
I have BindingList<> which is filled from the database. When I edit/delete the record from the grid which shows this list in UI and commit the transaction, it has no effect in database, but BindingList contains all changes. After deleting record I have no object which I can remove from the scope.
Should I realise event handlers like RecordsDeleting / CellUpdated in my datagrid component for manually removing objects from scope or there is other ways to get the same functionality?

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 24 Sep 2010, 05:02 PM
Hi 1,

You should handle the RadGridView.DataBindings.CollectionChanged event. There you should just commit the transaction so you can persist the changes to the database:

protected void DataBindings_CollectionChanged(object sender, CollectionChangeEventArgs e)
{
    if (scope.Transaction.IsActive)
    {
        scope.Transaction.Commit();
    }
}

Hope that helps.

Best wishes,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Development (API, general questions)
Asked by
Anatol
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or