Hi,
I have a treeview where I add nodes dynamically in code (LoadOnDemand). This works fine, but I need to "label" the different nodes with different images depending on what kind of node it is. This also works fine - as long as the images are always 16x16 pixels. If they are not (sometimes I need images of 16x32) then the images are resized to 16px wide.
I tried to make a template to handle images of this size and created a ControlTemplate with an Image with Height and Width set. But when doing this I don't seem to be able to display the Text of the node (in the Header property). Adding a TextBlock to the template only displays an empty string. What is worse, the expand button disappears. So I think my solution is a dead end...
Now can anybody explain to me how to create a template (or other solution), that custom set the size of the image for a RadTreeViewItem but leaves the rest "as is" and that can be set/applied in code??
Thanks!
I have a treeview where I add nodes dynamically in code (LoadOnDemand). This works fine, but I need to "label" the different nodes with different images depending on what kind of node it is. This also works fine - as long as the images are always 16x16 pixels. If they are not (sometimes I need images of 16x32) then the images are resized to 16px wide.
I tried to make a template to handle images of this size and created a ControlTemplate with an Image with Height and Width set. But when doing this I don't seem to be able to display the Text of the node (in the Header property). Adding a TextBlock to the template only displays an empty string. What is worse, the expand button disappears. So I think my solution is a dead end...
Now can anybody explain to me how to create a template (or other solution), that custom set the size of the image for a RadTreeViewItem but leaves the rest "as is" and that can be set/applied in code??
Thanks!