I am using Self-Referencing GridView in my WPF project and I am getting the output correctly. But I need the below things to do
1. Make the Header and Panel group for the child gridview as FALSE. Note: I have done it for the Parent Gridview.
2. I am binding the List Collection property to the grid for the child and individual properties for the Parent. I want to make visible false for GUID columns in the child grid (guid is there in the List collection. if i remove from collection, self referencing is not working).
Please help me to solve these issues.
Thanks,
Ram
11 Answers, 1 is accepted
Please take a look at this article for a reference.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

How I can implement the multiple column header in the below code
<telerik:RadGridView x:Name="RadGridView1"
ItemsSource="{Binding Path=P}"
GridLinesVisibility="Both" Width="700"
CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" IsReadOnly="True" AutoGenerateColumns="False" ShowGroupPanel="False" CanUserSortColumns="False" CanUserResizeColumns="False" CanUserReorderColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" Grid.Row="1"
DataLoading="RadGridView1_DataLoading" BorderThickness="0">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ServiceName}" Width="200" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding GeographyName}" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition>
<telerik:GridViewTableDefinition.Relation>
<telerik:TableRelation IsSelfReference="True">
<telerik:TableRelation.FieldNames>
<telerik:FieldDescriptorNamePair
ParentFieldDescriptorName="ID"
ChildFieldDescriptorName="ParentID"/>
</telerik:TableRelation.FieldNames>
</telerik:TableRelation>
</telerik:GridViewTableDefinition.Relation>
</telerik:GridViewTableDefinition>
</telerik:RadGridView.ChildTableDefinitions>
</telerik:RadGridView>
Thanks,
Ramasamy
Please take a look at this blog post. Is that the behavior that you want to achieve ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

http://demos.mcmscontrols.com/ASPNET/Controls/Examples/Integration/GridAndMenu/DefaultCS.aspx?product=grid
I want the same stuff to be accessed in WPF. I am using the RadGrid and on the cell right click, need to show the context menu.
Please help me how i can achieve this?
Thanks,
Ramasamy
You can create nested menu items just as illustrated in this article. The idea in RadContextMenu and defining its items should be the same.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

If I give like the below
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu x:Name="GridContextMenu" />
</telerik:RadContextMenu.ContextMenu>
Its showing an error "the type telerik:RadContextMenu is missing". I tried to add the assembly in the reference but i couldn't find the RadContextMenu assembly. I have already added Telerik.Windows.Controls assembly to my reference.
This is in WPF with MVVM pattern.
Thanks
Ramasamy
You may take a look at this article for a reference on the Controls Dependencies and which binaries you need for working with a particular control.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

In the self referencing grid, for the child grid i am getting the grey outline. I want remove that I have used BorderThickness (0,0,0,0). eventhough its coming. If I use left padding for the child grid then the left grey area is more.
Please help me to remove that outline.
Thanks,
Ramasamy
If you take a look at the default template of GridViewRow you may see a Border which surrounds the PART_HierarchyChildPresenter, just remove the Padding and it will disappear:
<
Border
BorderBrush
=
"#FF848484"
BorderThickness
=
"0,1"
Background
=
"#FFBBBBBB"
Grid.ColumnSpan
=
"2"
Grid.Column
=
"2"
Padding
=
"0"
Grid.Row
=
"2"
telerik:SelectiveScrollingGrid.SelectiveScrollingClip
=
"True"
>
<
Border.Visibility
>
<
Binding
Path
=
"IsExpanded"
RelativeSource
=
"{RelativeSource TemplatedParent}"
>
<
Binding.Converter
>
<
telerik:BooleanToVisibilityConverter
/>
</
Binding.Converter
>
</
Binding
>
</
Border.Visibility
>
<
ContentPresenter
x:Name
=
"PART_HierarchyChildPresenter"
ContentTemplate
=
"{TemplateBinding ContentTemplate}"
Content
=
"{TemplateBinding Content}"
ContentStringFormat
=
"{TemplateBinding ContentStringFormat}"
telerik:SelectiveScrollingGrid.SelectiveScrollingClip
=
"True"
/>
</
Border
>
Feel free to customize these settings in the way you need.
I am attaching you sample project illustrating this approach.
Kind regards,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

In the DataLoaded event, I have given like the below
private
void RadGridView1_DataLoaded(object sender, EventArgs e)
{
RadGridView1.Columns[0].IsVisible =
false;
RadGridView1.Columns[2].IsVisible =
false;
}
How can i make visible false for those 2 columns in the child grid of the self referencing grid vidw.
Thanks,
Ramasamy

I am using the CommonHeaders stuff for the multiple column headers.
<i:Interaction.Behaviors>
<local:ColumnGroupsBehavior>
<local:ColumnGroupsBehavior.CommonHeaders>
<local1:CommonHeader StartColumnIndex="0" Caption="" ColumnSpan="3" />
</local:ColumnGroupsBehavior.CommonHeaders>
</local:ColumnGroupsBehavior>
</i:Interaction.Behaviors>
My common headers are dynamic and need set in code behind. How it can be achieved at runtime.
Thanks,
Ramasamy