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

[Solved] Cascading Deletes with LinqtoSQL and Hierarchical RadGrid

1 Answer 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthew D
Top achievements
Rank 1
Matthew D asked on 10 Aug 2009, 11:44 PM
Would it be possible to modify or post an update to this article with the LinqDataSource as the provider?
Or just point us in the right direction for the DeleteCommand syntax.

http://www.telerik.com/help/aspnet-ajax/grdcascadingdeleteinhierarchicalgrid.html


Thanks




1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 13 Aug 2009, 03:34 PM
Hi Matthew D,

If you have access to your SQL database, you can set the ON DELETE CASCADE constraint for the relation linking your parent and detail tables. This will automatically have your database delete the related records.

If this is not a suitable approach for you, we best advise you to manually delete your related items again using LINQ from the data context object you have created for LinqDataSource.

You can find attached a small web site where I demonstrate how you can cascade delete your nested items manually from the same DataContext object the LinqDataSource is using.

All the best,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Matthew D
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or