views:

281

answers:

3

Hi all,

Can someone tell me how I can template a treeview control so that it doesn't look like a tree? Basically, I want to remove the indents at various levels as well as the +/- that allow for expansion and collapse.

The actual requirement is that I have a hierarchical data template that is bound to an object collection that is recursive in nature. And I want to display these objects on screen in a flat manner. The best solution would be to get the hierarchical data template to work with an itemscontrol. But sadly, i believe that the itemscontrol does not understand hierarchical templates. So I am forced to use a treeview control and strip all the "tree" features.

Any suggestions will be mighty helpful..

A: 
Carlo
man you solved my problem.. thankssssssssssssssss
Muhammad Adnan
@Muhammad Adnan: haha always glad I could help!
Carlo
But this way i loose expand/collapse feature of treeveiw... how can i have in this case...
Muhammad Adnan
A: 

You could probably do this with a template, but if the data doesn't need to be in a hierarchy then it makes more sense to flatten it in the ViewModel - possibly using AutoMapper.

Steven Robbins
+1  A: 
Jalfp