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 

Hiding columns from the header but keeping data displayed

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



Joined: 15 Jul 2011
Posts: 3

PostPosted: Fri Jul 15, 2011 4:45 pm    Post subject: Hiding columns from the header but keeping data displayed Reply with quote

Hello,
I need to display a hierarchical data in VirtualTree and each level should only have its own columns in the header. As a simple example, suppose I need to display customers with orders like that:
Customer1_Name Customer1_Address Customer1_Score
- Order1_1_# Order1_1_Date
- Order1_2_# Order1_2_Date
Customer2_Name Customer2_Address Customer2_Score
- Order2_1_# Order2_1_Date

and when I select a customer row then I want the header to display only Name, Address and Score columns but when I select an order then I want only Order# and Date colums. But at the same time I want to keep all data on the screen (in other words I only want to change the tree header and not the content of the tree). Is there any way to do this?
I can hide the columns belonging to the currently non-selected level by handling GetColumnInContext and checking what level is currently selected but that also removes data belonging to the hidden columns from the screen.
Thank you
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Jul 16, 2011 12:29 am    Post subject: Reply with quote

I'm not sure I quite understand what you want. Maybe you could post an image mock up of what it would look like.

You generally have two choices when displaying data items in Virtual Tree that have different fields.

1. You can use context sensitive columns - where Virtual Tree will automatically hide columns based on the currently selected item (or other conditions if you want). See the DataSet Browser sample for an example of this.

2. You display all columns for all possible fields and only display data in those that are relevant to each data item. The DataBase Browser sample illustrates this approach.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
konstantin



Joined: 15 Jul 2011
Posts: 3

PostPosted: Mon Jul 18, 2011 2:22 pm    Post subject: Reply with quote

What I want is for the tree header to display different columns based on what level is currently selected (in my example the header will either have Name, Address and Score columns or Order# and Date columns) but the tree itself should continue displaying data from all columns. In other words, when I select a different level it affects the tree header but nothing in the display of the data.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jul 18, 2011 10:38 pm    Post subject: Reply with quote

If you just want to change captions of the column headers then you could implement this yourself by handling the GetColumnInContext event and setting the Column.Caption for the column (but always setting InContext to true)
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
konstantin



Joined: 15 Jul 2011
Posts: 3

PostPosted: Tue Jul 19, 2011 3:12 pm    Post subject: Reply with quote

Changing captions will only work if all levels are using the same number of columns. In my example one level has 3 columns and the other has 2 so when the 2nd level is selected one column will be extra. Is there a way to hide any extra columns from the header but keep the data from them inside the control?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jul 20, 2011 12:09 am    Post subject: Reply with quote

Quote:
Is there a way to hide any extra columns from the header but keep the data from them inside the control?


No I don't think there is any easy way to do this. It might be possible to do what you are asking by creating a custom HeaderWidget and handling the layout of ColumnHeaderWIdgets yourself - but it would be a lot of work.
_________________
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