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

Grouped Binding

3 Answers 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 06 May 2009, 07:04 AM
Hello,

This is probably embarrassingly simple, but I haven't been able to work it out... I've got some data that look like this:

Group        ItemID        ParentID
Things         1                0
Things         2                0          
Things         3                2
Stuff             4                0
Stuff             5                4

I get that I can put it in a treeview using the standard binding properties with itemID and parentID... but I want to have the group as the first level thing.

I've done this in code using a big/silly/messy procedure, and that works, but it's slower than I'd like, and it sometimes times out when the treeview is rendering.

So yeah - is it possible to create the 3 levels with that kind of data?

Thanks,

Mike

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 06 May 2009, 08:12 AM
Hello Mike,

Can you please explain in more detail how do you want your treeview to look like?
Is it something like this?

Things
       |- 1
            |- 0
Things
       |- 2
            |- 0
Stuff
       |- 4
            |- 0
Stuff
       |- 5
            |- 4


Kind regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mike
Top achievements
Rank 1
answered on 06 May 2009, 08:15 AM
Hello,

Close - the key is that I want "things" and "stuff" to be grouped... It ideally should look like this:

-Things
   -1
   -2
        -3
-Stuff
    -4
         -5

Is that possible to do at all? The key would be basically making the top level a group and then doing a normal tree underneath those...

Thanks,

Mike

0
Veselin Vasilev
Telerik team
answered on 11 May 2009, 02:50 PM
Hello Mike,

Well, you need to manually iterate through your data and create the RadTreeNode objects and hierarchy. You might use the DataRelation class.

Kind regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Mike
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Mike
Top achievements
Rank 1
Share this question
or