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

Master/Detail relationship lost when editing

2 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
ToltingColtAcres asked on 29 Oct 2013, 02:06 PM
Have two grids with a master/detail relation created per the online example at:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/master-detail/defaultvb.aspx?#qsf-demo-source

All works well, when records are selected in the master grid, the detail grid updates.

However, when I place a record in the master grid in edit mode, the relationship to the detail grid is lost, presumably, because the 'SelectedItems' collection within the master grid becomes null (from what I've been able to determine via tracing)... the detail grid then automatically updates and becomes blank, losing the connection between the master and detail grids.

Is there a way to prevent that from happening? I would like to have the detail data for the record in edit mode appear in the detail grid for reference purposes..

2 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 01 Nov 2013, 11:28 AM
Hello Michael,

The behavior you are experiencing is expected as when an item is opened for edit RadGrid recreates it's structure and clears the selected indexes collection. In order to avoid this you can set the edit item as selected in the PreRender event of the grid and rebind the second RadGrid. Following this approach I have assembled a sample website for you to review. The example should help you modify the real code logic.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
answered on 01 Nov 2013, 02:18 PM
Works. Awesome. Thanks.
Tags
Grid
Asked by
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
Answers by
Angel Petrov
Telerik team
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
Share this question
or