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

Background image Layout

4 Answers 143 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Juan Pablo
Top achievements
Rank 1
Juan Pablo asked on 24 Nov 2008, 04:30 PM
Hello experts!
Look, I have a radtreeview with a background image, but I need that that image always displays at the bottom left side of the control. How I can accomplish this?

I tried with all the layouts available, and mixed them with different image sizes, but I'm not getting the desired results.

Thank you for your help!

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 28 Nov 2008, 01:29 PM
Hello Juan Pablo,

Thank you for the question.

There are two approaches that I would suggest:
  • Making an image appropriate for your needs. The background color of this image will be the back color of RadTreeView, its size will be equal to the size of RadTreeView and the desired 'bottom-left' image should be placed in the bottom left part of the this RadTreeView-sized image.
  • Add an ImagePrimitive to RadTreeView and assign it your 'bottom-left' image. Please note that, if you want to follow this approach, you should turn off the RadTreeNodes' animations. To do so, make your custom theme, where the Animate checkboxes of the TreeNodeUI's state tabs are unchecked. In addition, in your project, you should call RadTreeView.Invalidate() whenever you move the form and RadTreeView.InvalidateNode when the mouse pointer is leaving a node.

I have demonstrated both approaches in the sample project attached. I hope this helps. If you have additional questions, feel free to contact me.

Sincerely yours,

Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Juan Pablo
Top achievements
Rank 1
answered on 28 Nov 2008, 03:35 PM
Thanks for your reply and for your example.
Now I notice that I didn't explain me well.

Look, the tree view is docked to a tablelayoutpanel that resizes when the parent resizes. And the image should always appear at the bottom left corner.

Thanks for your help
0
Accepted
Nikolay
Telerik team
answered on 01 Dec 2008, 03:34 PM
Hi Juan Pablo,

In the case of a runtime resized RadTreeView, you should use the ImagePrimitive approach. Just set the correct Location whenever the Size of RadTreeView is changed:
void radTreeView1_SizeChanged(object sender, EventArgs e)  
{  
    img.Location = new Point(0, this.radTreeView1.Height - RadTreeViewImage.Properties.Resources._1_New.Height);  

I am attaching a modified version of my project to demonstrated the approach. If you need additional assistance, feel free to contact me.

Regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stefan
Telerik team
answered on 18 Mar 2011, 08:25 AM
Hi Juan Pablo,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out.
For more information about this release, please refer to this blog post.
 
All the best,
Stefan
the Telerik team
Tags
Treeview
Asked by
Juan Pablo
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Juan Pablo
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or