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

AddSelfReference to Relations in GridViewTemplate

3 Answers 166 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 13 Mar 2014, 07:06 PM
I have a winform app that is using Telerik RadGridView. It has several GridViewTemplate and in 1 of the GridViewTemplate I want to have self reference relation, so my question is
- can I cast GridViewTemplate to RadGridView so I use
         RadGridView.Relations.AddSelfReference
- or can have some way that I can use directly
         GridViewTemplate.Relations.AddSelfReference

Thanks.
Tom

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Mar 2014, 12:54 PM
Hello Tom,

Thank you for contacting Telerik Support.

Adding Relations to set up the SelfReference hierarchy in RadGridView is possible only for the MasterGridViewTemplate. If I understand your requirement correctly, you are trying to set up a mixed hierarchy in RadGridView: adding several GridViewTemplates to build a classic hierarchy and adding a relation to one of the child templates to construct self reference hierarchy. Currently, we do not have plans to support binding to self referencing data for child templates. Our team will take your suggestion into considerations for future releases. 

Our (Re)Mixed Hierarchy Mode in RadGridView for WinForms blog post gives an example of what RadGridView supports regarding a SelfReference hierarchy mixed together with the classical hierarchy mode.

As a suggestion, it is possible to set up the hierarchical data in the SelfReference table via the Binding to Hierarchical Data Programmatically approach. Our GridView - Hierarchy - Tabbed Views might be useful as well.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Tom
Top achievements
Rank 1
answered on 19 Mar 2014, 12:54 AM
Hi, 
I have 1 gridview in the form.
I want to have 4 subtemplates in that gridview.
- 2 subtemplates will be load when form load by having DataSource assigned and AutoGenerateColumns = true (using DataBinding)
- 2 other subtemplates load with gridview_RowSourceNeeded event. (use Load On Demand)

Can I do mix like that or I can only choose 1 of either types, if using the DataBinding, I have to use DataBinding for all 4 tabs. If using Load On Demand, I have to use Load On Demand for all 4 tabs.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Mar 2014, 04:54 PM
Hello Tom,

Thank you for contacting us again.

It is possible to set up two of the templates using data binding and another two via load on demand. It is necessary to add the GridViewTemplate and specify its HierarchyDataProvider. Please find attached a sample project, demonstrating this functionality.

Our Load-On-Demand Hierarchy is quite useful about this topic.

Please do not hesitate to contact us if you have any additional questions.
  
Regards,
Desislava
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
GridView
Asked by
Tom
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Tom
Top achievements
Rank 1
Share this question
or