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 

How to programmaticallyretrieved the icon set to a tree node

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



Joined: 10 Apr 2008
Posts: 32

PostPosted: Tue Jul 14, 2009 7:50 am    Post subject: How to programmaticallyretrieved the icon set to a tree node Reply with quote

I have a need to programmatically retrieve the icon previously set for a row via the 'virtualTree1_GetRowData' event handler. The only thing i have access to is the Row.Item reference (i.e. a referent to the tree node itself).

Is there not a way to get from the Item to the rowdata?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jul 14, 2009 11:20 pm    Post subject: Reply with quote

Virtual Tree only keeps the RowData for the Rows that are currently displayed. So probably the simplest thing to do is to call the binding yourself to get RowData eg

Code:
RowBinding binding = _virtualTree.GetRowBinding(e.Row);
RowData rowData = new RowData(_virtualTree);
binding.GetRowData(e.Row, rowData)


Virtual Tree does keep a cache of the RowData for the currently displayed rows (just those actually visible). The GetDataForRow method checks this before return the RowData - however this method is protected so you have to derive a new class and provide a public method to call this if you wanted to make use of it. Unless you are calling this method at a very high frequency the first suggested method would suffice.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
JohnSummit



Joined: 10 Apr 2008
Posts: 32

PostPosted: Wed Jul 15, 2009 5:10 am    Post subject: Reply with quote

Thanks. I ended up caching the icon in my item object directly.
Back to top
View user's profile Send private message
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