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

Element is already the child of another element in nested GridView

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
madladuk
Top achievements
Rank 2
madladuk asked on 26 May 2010, 11:48 AM
Hi all.

I have a gridview that then links to a second set of entities that is the detail. In the detail grid I can return the column values however when I tryto place a combo box in here I receive the following error "Element is already the child of another element."

In the sub details I have a column called "roleguid" this is then linked another table on the column "rowguid". Basically the sub table is a table that holds the guids of the roles the template belongs to, I am then linking this in the combo box so that the role description can be shown. If I use a textbox I can see the value of "roleguid" in the details nested view however adding the combo boxes causes the error.

<telerik:RadGridView.HierarchyChildTemplate> 
                                <DataTemplate> 
                                    <telerik:RadGridView x:Name="radGridView1" CanUserFreezeColumns="False" AutoGenerateColumns="False"   
                                                         ItemsSource="{Binding DOC_TYPES_ROLES}"  ShowGroupPanel="False" IsReadOnly="True">  
                                        <telerik:RadGridView.Columns> 
                                            <!--<telerik:GridViewDataColumn DataMemberBinding="{Binding roleguid}" Header="Guid" />--> 
                                            <telerik:GridViewComboBoxColumn Header="Type" 
                                                            ItemsSourceBinding="{Binding Data, Source={StaticResource ddsRoles}}" 
                                                            DataMemberBinding="{Binding templateid}"   
                                                            DisplayMemberPath="roletext"   
                                                            SelectedValueMemberPath="roleguid" /> 
                                        </telerik:RadGridView.Columns> 
                                    </telerik:RadGridView> 
                                </DataTemplate> 
                            </telerik:RadGridView.HierarchyChildTemplate> 
 

1 Answer, 1 is accepted

Sort by
0
madladuk
Top achievements
Rank 2
answered on 26 May 2010, 12:02 PM
Sorted it now, the problem was in my binding of the combo-box, still getting my head around the binding aspects ! Thanks in advance;
Tags
GridView
Asked by
madladuk
Top achievements
Rank 2
Answers by
madladuk
Top achievements
Rank 2
Share this question
or