Solved

VirtualTreeView - no of columns based on width

Posted on 2013-11-08
2
332 Views
Last Modified: 2013-11-16
Hi

I have a Properties grid (VirtualTreeView) and it can hold from 5 - 50 lines... in 2 columns: Property, Value. The thing is that this info is for a selected object from the main grid, and since Properties grid has just a portion of screen space below the main grid, I would like to explore options how to better display Properties grid if the screen is wide enough to hold data in 4,6 or 8 columns instead of just 2.

So, Property colomn is width = 100, Value column width = 100. this is only 200 width per row. And if we have 30 lines, now you need to scroll, as only 5-8 rows fit on the screen. I would like to change the grid to show 10 columns (5 x Property & Value columns), if the screen width is > 5x200 - 1000, which usually is. So, I need to change from 1x30 (Prop&Value columns x rows) grid into 5x6 (5x Prop&Value columns, 6 rows) and all data is visible without any scrolling up and down.

I'm attaching screenshot from Excel for better understanding. So, if I have more screen space, I would like to display data in more columns and less rows, and that it is dinamyc on resizing form.

Thank you for your help!
0
Comment
Question by:Delphi_developer
  • 2
2 Comments
 

Author Comment

by:Delphi_developer
ID: 39634596
Attached file to show a design instead of just 2 columns, of 5x2 columns if the screen is wide enough. If it's only wide enough for 4 columns, then display in 4 columns.
temp.png
0
 

Accepted Solution

by:
Delphi_developer earned 0 total points
ID: 39653101
This is current solution:

I have 2 data sets, first one is the data I want to display, the second one is 'visual' data - what  I display. And OnResize I calculate the number of columns I can fit in the width of TreeView and based on this number I populate data into visual data set, so it is evenly distributed over rows and columns.
Works good, for now.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Strange code, can use it, but i cant figure out what it does. 3 66
How to fill array with TArray.Create? 14 94
Printing problem 2 101
Delphi inherited method 6 76
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question