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

Hierarchical Bind Guidance

4 Answers 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hunter
Top achievements
Rank 1
Hunter asked on 05 Apr 2012, 05:23 PM
Hello everyone,
I've been using Telerik's aspx AJAX controls for a while now and I just started to review their winforms controls for a legacy project. I've read through the online documentation for the GridView and I'm still struggling to bind my data successfully. Here's my structure.

Rooms
- Products
- - Related Products

I need each level to be capable of drag and drop to other controls in the application so it appears that I need a total of three templates (two in addition to the master). In my testing I've been manually databinding the grid and I've managed to load my rooms when the form loads. I've then chosen to use the "MasterTemplate_RowSourceNeeded" to load my first level products when a room is expanded (which works as expected). Now I'm struggling to add the final level (Related Products). I've tried adding a Related Products template at runtime when the Products level is being filled (no issues here). I then added a relationship to the gridview to relate the products with their related products and while this doesn't produce an error the Related Products aren't visible in the gridview. I then tried manually creating each Related Product row within the related template using a dataview's filter to get the related products. Again this ran without error but clicking the drop arrow next to the Product only changes the drop arrow to the opened state with no Related Products being shown. I've tried to watch a handful of the databinding videos on Telerik's website but the video doesn't show (like a white box is over the video).

Any help is greatly appreciated :)

4 Answers, 1 is accepted

Sort by
0
Hunter
Top achievements
Rank 1
answered on 06 Apr 2012, 05:45 PM
Figured it out... I went into this thinking the gridvew would act more like a treeview with a gridview for each node. After fighting with this for a while I finally wrapped my head around it (I think). I do still have one question though. Is there a way to easily implement a treeview like connecting line from one template to another?

Ex.
Row 1
|_Row 2
   |_ Row 3
0
Accepted
Julian Benkov
Telerik team
answered on 10 Apr 2012, 08:55 AM
Hello Hunter,

Thank you for writing. 

The implementation of hierarchy mode depends on your data. When the presented data for Row1, Row2, etc is from the same type, the most suitable hierarchy mode is self-reference. If the presented data is from different types, you can bind to a hierarchy containing one to many relations or use load-on-demand, just like your started to with Rooms, Products, Related products.

If you continue to experience the issue, please send us a demo project with your hierarchy mode setup to investigate it locally and find best solution for your application. 

On a side node, please provide me with a link to the problematic video, so I can report it to the respective department.

All the best,

Julian Benkov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Hunter
Top achievements
Rank 1
answered on 10 Apr 2012, 04:18 PM
Thank you for your response :) Through some digging I was able to create the hierarchy I was after. Yes, the first level contains locations while all subsequent levels contain products so I chose to use the "load on-demand" approach which works nicely. I had replied to my earlier post as I was still struggling to find a way to connect each template visually with lines (like a treeview). After failing to come up with a solution I've abandoned this idea for now.
 
PS - I was able to fix the video issue by disabling hardware acceleration in the player. Nothing wrong on your end :)
0
Julian Benkov
Telerik team
answered on 13 Apr 2012, 02:46 PM
Hello Hunter,

I am glad to hear that you have found a solution for your hierarchy data representation and issues.

To support lines in the UI you can replace the RadGridView control with RadTreeView control. The RadTreeView control also support load-on-demand data loading and sorting and filtering operations.

I hope this helps. Let me know if you need further assistance.

Greetings,
Julian Benkov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Hunter
Top achievements
Rank 1
Answers by
Hunter
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or