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

Self-Referencing GridView in WPF

11 Answers 236 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ramasamy
Top achievements
Rank 1
Ramasamy asked on 23 Sep 2011, 04:51 AM
Hi,

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

Sort by
0
Accepted
Maya
Telerik team
answered on 23 Sep 2011, 06:48 AM
Hi Ramasamy,

Please take a look at this article for a reference.
 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ramasamy
Top achievements
Rank 1
answered on 23 Sep 2011, 08:20 AM
Hi,

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

 

0
Accepted
Maya
Telerik team
answered on 23 Sep 2011, 08:25 AM
Hello Ramasamy,

Please take a look at this blog post. Is that the behavior that you want to achieve ?
 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ramasamy
Top achievements
Rank 1
answered on 23 Sep 2011, 09:29 AM
Hi,

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
0
Accepted
Maya
Telerik team
answered on 23 Sep 2011, 09:54 AM
Hello 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.
 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ramasamy
Top achievements
Rank 1
answered on 23 Sep 2011, 10:36 AM
Hi,

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

 

0
Accepted
Maya
Telerik team
answered on 23 Sep 2011, 10:38 AM
Hi 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.
 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ramasamy
Top achievements
Rank 1
answered on 24 Sep 2011, 04:50 AM
Hi,

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
0
Accepted
Vanya Pavlova
Telerik team
answered on 26 Sep 2011, 09:06 AM
Hi 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 >>

0
Ramasamy
Top achievements
Rank 1
answered on 27 Sep 2011, 05:09 AM
Hi,

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

 

0
Ramasamy
Top achievements
Rank 1
answered on 27 Sep 2011, 09:18 AM
Hi,

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

 

Tags
GridView
Asked by
Ramasamy
Top achievements
Rank 1
Answers by
Maya
Telerik team
Ramasamy
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or