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 

indenting non-main columns like the main column

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



Joined: 12 Nov 2006
Posts: 7
Location: Charlotte NC

PostPosted: Sat Nov 18, 2006 6:42 pm    Post subject: indenting non-main columns like the main column Reply with quote

Is there a way to indent columns other than the main column based on depth. This would make the data more readable with large amount of data.


Desired Appearance:

A    X X X
|
+-B   X X X
|
C    X X X


More goal is a little more complex than above because I'm displaying numbers where the Xs are above and they are right justified. I tried right padding the values with spaces, but they appear to be getting trimmed because the cell is right justified.

Any ideas are appreciated.

Thanks,
_________________
Michael Miller
HalfTime Technologies
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Nov 18, 2006 9:53 pm    Post subject: Reply with quote

I'm not sure I fully understand the problem here. Why is you data not readable with the XXX data in a separate non-indented column?

From your desired appearance it looks like the XXX numbers are no longer in a single column. You could achieve this by simply including the XXX numbers in the text for the main column. You would do this by handling the GetCellData event and formatting a string that includes both the A/B/C text and the XXX text.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Halftime



Joined: 12 Nov 2006
Posts: 7
Location: Charlotte NC

PostPosted: Sun Nov 19, 2006 1:22 pm    Post subject: Reply with quote

I'm not saying the data is NOT readable, I'm only implying that If I could apply a small indent to the subordinate cells it would be more readable IMO. I still want to keep the #s in their own column - just slightly offset them for aesthetics.

EX: Notice children B and C are slightly indented from its parent, but still in the same column.

-------ACCOUNT-----|------11/1/12006-----|
============================|
----------A------------|--------$3,210---------|
----------+--B--------|------------$1,900-----|
----------|---C--------|------------$1,310-----|
----------D------------|---------$4,735--------|


I'm using the treeview to display financial # and the childrens #s are contributions to the parent. seeing this with a slight indent makes it more readable IMHO. Prior to using virtualtree I used the Windows treeview control and a fixed pitch font (Courier 10) so the spacing was identical - I formatted each node to have the correct spacing so you could easily see contributions to the parent - I was however limited 1 only displaying #s for 1 day - with virtualtree I'm now showing 5-10 days of daya accross a page.

Thanks
_________________
Michael Miller
HalfTime Technologies
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Nov 19, 2006 10:04 pm    Post subject: Reply with quote

It would be possible to do this by handling the GetCellData programmatically for these cells and inserting the required spaces based on the Row.Level in the format string eg

Code:
private void _virtualTree_GetCellData(object sender, GetCellDataEventArgs e)
{
     RowBinding binding = _virtualTree.GetBindingForRow(e.Row);
     binding.GetCellData(e.Row, e.Column, e.CellData);
     if (e.Column != _virtualTree.MainColumn)
     {
          e.CellData.Format = new string(' ', e.Row.Level) + "{0}";
     }
}


Another alternative would be to create a custom CellWidget and handle the painting yourself - this would allow you to use non-fixed pitched fonts more easily.
_________________
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