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 programmatically implement Context Sensitive Columns

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



Joined: 15 Sep 2009
Posts: 5
Location: Pretoria, South Africa

PostPosted: Tue Mar 29, 2011 12:21 pm    Post subject: How to programmatically implement Context Sensitive Columns Reply with quote

I am programmatically binding data in my Virtual Tree (similar to the Sample).

How would I programmatically enable the VT to only show columns that are relevant to certain Rows.

Lets say for this example I have Group typed items and Member typed items. For Group I have a column Count and for Member a column Colour. I only want to show the Count column when a Group item is selected and only Colour when a Member is selected.

I have allready set the two columns' ContextSensitive to "true".

I understand that I would have to set up some sort of binding as well, but dont know where or how.

The only binding currently happening is in _GetChildren, as follows

Code:
Group^ l_pGroup = dynamic_cast< Group^ >( l_pEventArgs->Row->Item );

l_pEventArgs->Children = l_pGroup->Children;


Any pointers in the right direction would be highly appreciated Smile

G
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Mar 29, 2011 11:16 pm    Post subject: Reply with quote

To implement context sensitive columns programmatically you should should handle the GetColumnInContext event (or override the ColumnInContext method) and set the e.InContext property. This event is called for each column, you should set the value to be true if you want the given column displayed for the current ContextRow.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Ger83



Joined: 15 Sep 2009
Posts: 5
Location: Pretoria, South Africa

PostPosted: Wed Mar 30, 2011 4:44 am    Post subject: Reply with quote

Hi.

Thanks for the reply. My main problem was actually that I did not set up the "Object bindings" in the Virtual Tree Editor. So what I did (which I did not actually know one should do), is create an object binding, add the columns that should be displayed for the binding and then give the Type (which I totally messed up). Initially I gave the type as "Namespace::Namespace::Class", where I should have given it as "Namespace.Namespace.Class". After I did that, and set the columns as "ContextSensitive = true", it worked.

G
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