Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Please help a newbie evaluating Virtual Tree

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
Martin_sbt



Joined: 07 Jun 2006
Posts: 1

PostPosted: Wed Jun 07, 2006 7:54 pm    Post subject: Please help a newbie evaluating Virtual Tree Reply with quote

Hi

I am evaluating your virtual tree control and i need help. In my VB,net app, i am parsing a text file and retrieve strings in the following format:

Group1,"Group1 descriptor"
Group2,"Group2 descriptor",Group1 ----->(the third delimited string tell me that "Group2" is a sub node of Group1

and so on....

Anyone can provide me with a code example on how i could populate the virual tree with that infos??? I am not good in data bound way of doing things so please help me figure it out!

If i can figure out how to work with your control, i will buy it right away!!!

thanks in advance

Martin
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jun 07, 2006 10:58 pm    Post subject: Reply with quote

Basically you just create your own class structure to represent your data and Virtual Tree can then be bound to display that data. For instance you might create a "Group" class which has:
- a Description property
- a "Children" property - which is a list of the child Groups; and
- a "Parent" property which is the parent Group (if any)

You can then create ObjectBindings (in the Virtual Tree design time editor) that bind to the properties of your Group class. Take a look at the SimpleTree example code. It does exactly this with a class called "Part". Let us know if you need any more assistance.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Jun 08, 2006 12:31 am    Post subject: Reply with quote

I am working in vb.net only for a couple weeks so i am not as comfortable as you are! Smile Now i have been looking at the example you are talking about the entire afternoon and i am thinking that there must be an easiest way to fill the control the way i want it to work without having to write a class everytime i want to use this control! There must be an easiest way for dummy users like me! Shocked

Also, i need to be able to put icons on each nodes (icon is different depending of the node type or group if you prefer). Is there any other way??
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Jun 08, 2006 9:10 am    Post subject: Reply with quote

You're missing the point of data binding a little bit. In any real application you should be writing your own classes and data structures to store and access your data. Data binding then allows you to display this data without having to build a separate set of user interface objects (ie tree nodes). If you have a separate set of user interface objects (eg tree nodes) then maintaining the relationship between these and your data objects when things change can be a lot of work and error prone. Data binding helps you out by managing this for you.

If you just want to build a quick and dirty user interface prototype (ie no real application logic behind it) then data binding will probably seem like more work. For real applications however it is much less work and provides you with a very clean separation between your application data model and the user interface - which means if you need to change the user interface you can do so without rewriting your entire application.

There are two possibilities to handle the icons. If you are representing different types of data objects by different icons and each data object is of a different class then you can simply create separate DataBindings for each class and assign them different icons in the design editor. For instance your might have a base class called Group and then derived classed called HomeGroup and WorkGroup. You would add separate bindings for HomeGroup and WorkGroup classes and assign them different icons.

The second option is to handle the GetRowData event and assign the icon programmatically based on whatever criteria you want.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group