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

Using treelist without children

7 Answers 169 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 16 Mar 2011, 12:09 PM
Hello,

I have created a usercontrol where I show an overview of rows from an entity. So far all this entities had a hierarchie (parentid). Now I have an entity (table) without a hierarchie. In other words, the treelist only have to show one level. Because I want to reuse this usercontrol I like to know if it is possible. I had removed the property ParentDataKeyNames but that the Exception:

KeyNames collection length must match ParentKeyNames collection length.


Is it possible what I want?

Kind regards,

Patrick

7 Answers, 1 is accepted

Sort by
0
Accepted
Mira
Telerik team
answered on 17 Mar 2011, 04:56 PM
Hello Patrick,

In order to have all items as roots items in the RadTreeList, their parent data key value should be NULL or the default value for the type.

To overcome this, you can use the approach from the project attached to this message.

However, I recommend the usage of RadGrid in this scenario.

Best wishes,
Mira
the Telerik team
0
Patrick
Top achievements
Rank 1
answered on 17 Mar 2011, 05:26 PM
Thx, that did the job!
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 28 Mar 2011, 07:41 PM
One question i hve for treelist:  Can I have multiple tables implemented in the treelist?  for example Users --> Addresses  (where users have multiple addresses),  so it is a standard one to many relationship, and the tables are not self referencing.  I want to be able to use the treelist because it is the most visually 'correct' way that the customer wants to view and edit the data.

Thanks.
0
Sebastian
Telerik team
answered on 29 Mar 2011, 09:14 AM
Hi Chris,

RadTreeList supports only self-referencing tables/structures. If you need to use several source tables to represent hierarchy, consider using our AJAX web grid for this purpose. Review the demos under the 'Hierarchy' node here for more details:

http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx
 
Best regards,
Sebastian
the Telerik team
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 29 Mar 2011, 06:07 PM
Ok.  Thanks very much.  What about your listview control?  What advantage does listview have over gridview in this situation?

0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 29 Mar 2011, 06:13 PM
Ok.  Thanks very much.  What about your listview control?  What advantage does listview have over gridview in this situation?

Also for gridview, is it possible to have the lines on it to make it look like the treelist does?

Thank you again.


0
Sebastian
Telerik team
answered on 30 Mar 2011, 09:02 AM
Hello Chris,

Our AJAX ListView control is used to display flat data structures using a set of predefined or custom layouts. To align the columns in each level of a RadGrid hierarchy, utilize the solution depicted here.
 
Best regards,
Sebastian
the Telerik team
Tags
TreeList
Asked by
Patrick
Top achievements
Rank 1
Answers by
Mira
Telerik team
Patrick
Top achievements
Rank 1
Chris @ Intrinsic
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or