Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VirtualTreeView - no of columns based on width

Posted on 2013-11-08
2
Medium Priority
?
370 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

972 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