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 

Expansion Icon

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





PostPosted: Wed Mar 09, 2005 12:28 am    Post subject: Expansion Icon Reply with quote

Anyway to turn off the + next to a node that has no children?

I'm using the RowChildPolicy.LoadOnExpand policy since I have lots of data that I want to only load on demand.

I need to turn off the + for rows that I know have no children when the row is asked for it's cell data.

Thanks,

Mark
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Mar 09, 2005 2:59 am    Post subject: Reply with quote

Simply set the RowChildPolicy to be RowChildPolicy.Normal for rows that you know never have children. This will mean that VirtualTree will request the children for that row immediately, discover there are none and so not display the expansion symbol.

Typically you know that certain row types never have children and so you can set the ChildPolicy in the RowBindings (using the editor if you are using data binding). If you are using programatic data binding then set the RowChildPolicy in the GetRowData event/method based on the type of the row.Item.

I would usually only use LoadOnExpand for the top level rows and only then if experience showed that performance was going to be an issue - because it forces the user to click on the expand symbol to see if a row has children and so removes some useful information.

Regards
Grant
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Mark Johnson
Guest





PostPosted: Wed Mar 09, 2005 5:47 pm    Post subject: Reply with quote

Thanks, got it to work.
Back to top
Longmountain



Joined: 02 Aug 2006
Posts: 4

PostPosted: Fri Aug 11, 2006 12:07 pm    Post subject: Reply with quote

Now with 3.0, is it possible to specify each row whether there are child’s present? So that the + won’t be visible for rows which doesn’t have any child’s.

I'm using the RowChildPolicy.LoadOnExpand policy. The object in the row has a property indicating there are child’s present in the database. Perhaps it’s possible to use this property in the VirtualTree_GetRowData event to change row attributes?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Aug 11, 2006 2:31 pm    Post subject: Reply with quote

The whole point of RowChildPolicy.LoadOnExpand is that Virtual Tree will not check the node to see if it has children. This can improve performance - depending on how long that check takes but means that the + has to be shown until the user clicks it.

If you don't want the + shown when there are no children then use RowChildPolicy.Normal.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Longmountain



Joined: 02 Aug 2006
Posts: 4

PostPosted: Fri Aug 11, 2006 2:44 pm    Post subject: Reply with quote

The node doesn't have to check if it has children because the node already knows. The node doesn't yet contain the children but an indication property "HasChildren" as a bool.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Aug 11, 2006 11:53 pm    Post subject: Reply with quote

You can handle the GetChildPolicy event (or override the GetChildPolicyForRow method) and set the ChildPolicy to LoadOnExpand only for your nodes that have your HasChildren flag set to true.
_________________
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