Recent

Author Topic: TControlGrid  (Read 5265 times)

serbod

  • Full Member
  • ***
  • Posts: 142
TControlGrid
« on: August 27, 2016, 11:57:48 pm »
I need grid with scrollbars, where cells contains visual control (label, image, edit, frame..) aligned to alClient.

Now i use TScrollBox with custom alignment of nested controls, it's works, but not handy. TFlowPanel is handy, but it's not grid and don't have scrolling. Is here any solution or ideas, how to make scrollable grid of controls, with changeable column width, rows sorting and filtering, virtual rows (filled only when visible)?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TControlGrid
« Reply #1 on: August 28, 2016, 12:11:06 am »
Did you try TStringGrid?


serbod

  • Full Member
  • ***
  • Posts: 142
Re: TControlGrid
« Reply #2 on: August 28, 2016, 01:13:01 am »
Did you try TStringGrid?
Yes, and many other grids too - VirtualTreeView, BergSoft NextGrid, TMS AdvGrids.. They have fixed-type columns with limited range of stored controls.

I just need to insert controls into grid cells at design-time, so controls will be aligned automatically. If grid contains only 1 column, it will be list. If contain only 1 row - it works just as TControlBar.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TControlGrid
« Reply #3 on: August 28, 2016, 01:30:14 am »
I guess I don't understand what you're trying to do. If all of those different grids can't handle your needs, then you'll need to write your own.

Perhaps if you describe what you're trying to accomplish, not in terms of a grid but in terms of the UI.

(There's also the Orpheus grid, which I ported years ago. It worked pretty good on Windows.)





JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TControlGrid
« Reply #4 on: August 28, 2016, 08:56:48 am »
Try the TKGrid which is part of the KControls suite http://tkweb.eu/en/delphicomp/

It has a demo that shows how to place several different types of controls in the TKGrid.

Maybe that will suit your purpose.
« Last Edit: August 29, 2016, 12:01:59 pm by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

serbod

  • Full Member
  • ***
  • Posts: 142
Re: TControlGrid
« Reply #5 on: August 29, 2016, 10:43:58 am »
Try the TKGrid which is part of the KControls suite http://tkweb.eu/en/delphicomp/
Maybe that will suite your purpose.

Thanks for suggestion! TKGrid basically is advanced grid of strings or custom drawn cells, not nested controls. Some controls can be nested as inplace editor in OnEdit event. But impossible to place controls in grid at design time, as TFlowPanel.

patyi

  • Full Member
  • ***
  • Posts: 168
Re: TControlGrid
« Reply #6 on: August 29, 2016, 11:27:55 pm »

tk

  • Sr. Member
  • ****
  • Posts: 361
Re: TControlGrid
« Reply #7 on: September 01, 2016, 08:02:38 pm »
Quote
I need grid with scrollbars, where cells contains visual control (label, image, edit, frame..) aligned to alClient.
I doub't there is a grid control capable of this.
Anyway, why would you need this? I think it is better (and much faster) to just paint some content to grid cells and edit the content via one inplace editor at a time.

serbod

  • Full Member
  • ***
  • Posts: 142
Re: TControlGrid
« Reply #8 on: September 02, 2016, 01:17:39 pm »
Quote
I need grid with scrollbars, where cells contains visual control (label, image, edit, frame..) aligned to alClient.
I doub't there is a grid control capable of this.
Anyway, why would you need this? I think it is better (and much faster) to just paint some content to grid cells and edit the content via one inplace editor at a time.

Look at this fourum page. It contains list of repaeted elements - posts. Every post have userinfo side, title, body, footer. How can you do same thing in LCL?

If use direct canvas drawing, it will take very many pages (not even lines!) of code and many time to tune positions, sizes, etc.. But now is post-visual programming age! Just place labels, images and buttons on TFrame! And add that frame on TFlowPanel for every post. It will not only looks like exactly as designed, but every item works without inplace editors, global event handlers and other crutches.

 

TinyPortal © 2005-2018