This is a migrated thread and some comments may be shown as answers.
Custom RadTreeNode
5 Answers 94 Views
This is a migrated thread and some comments may be shown as answers.
Antonio
Top achievements
Rank 1
Antonio asked on 18 Nov 2009, 02:23 PM
Some time ago I needed to implement progress bars on my radlistboxitems which I found to be pleasantly easy to achieve. I have done similar modifications to radelement trees on a number of the other controls with no problem but I am now keen to modify the radtreeview somewhat - Only nor the radtreeview nor radtreeviewnodes appear to have a radelement tree like the others. The tree is there but it is very simplistic and with absolutely no breakdown of fillprimitives , borderprimitives and the usual layout panels combined with the standard primitives. Am I missing something ? I won't detail every change I am keen to try but one change I really "need" is to be able to implement a progressbar element on a radtreenode .

5 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 23 Nov 2009, 08:27 AM
Hello Antonio,

Thank you for writing. It is true that RadTreeView does many things differently from the other controls. For example, its layouts are custom and take into account only specific properties. I am afraid that there is no easy way to incorporate custom elements inside the tree nodes because there is no way to make the current layout mechanism include those elements in the calculations.

Thank you for your understanding. Please write again if you have other questions.

All the best,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Antonio
Top achievements
Rank 1
answered on 23 Nov 2009, 07:02 PM
Thanks for the reply Victor , in the course of my playing around to find a solution I found the RadElement method GetAsBitmap. I see also that the RadTreeView has a DrawNode event that passes a graphics object allowing you quite a bit of drawing functionality. Unfortunately I seem to have no luck returning an image when using it on a RadElement. I continuously get a null from the function. I can't find much direction in the documentation on this function . If I could get the image from a RadElement , then I could , to some degree achieve some of the customisation I want in my RadTreeNode appearances. Perhaps there is somewhere else I could find more detail on the correct use of this function ?

In particular I would like to get back a RadProgressBarElement as a bitmap.

Thanks again for your help,
Antonio.
0
Accepted
Victor
Telerik team
answered on 26 Nov 2009, 03:43 PM
Hi Antonio,

All RadElements will return null when they are in an invalid state (see ElementState property). In order to be in a valid state an element must be associated with a RadControl instance.
What you need to do is to create a RadProgressBar control, call its LoadElementTree() method and get the bitmap from the RadProgressBarElement instance that is associated with the control. For example:
RadProgressBar p = new RadProgressBar();
p.LoadElementTree();
 
Image img = p.ProgressBarElement.GetAsBitmap(Brushes.White, 0.0f, new SizeF(1.0f, 1.0f));

Please write again if you need further assistance.

Sincerely yours,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stefan
Telerik team
answered on 18 Mar 2011, 08:28 AM
Hi Antonio,

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
0
Antonio
Top achievements
Rank 1
answered on 18 Mar 2011, 10:55 AM
Awesome, thank you.
Asked by
Antonio
Top achievements
Rank 1
Answers by
Victor
Telerik team
Antonio
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or