Recent

Author Topic: Showing one datafield across a whole dbgrid  (Read 3535 times)

corpusgemini

  • New Member
  • *
  • Posts: 19
Showing one datafield across a whole dbgrid
« on: October 04, 2014, 05:10:34 pm »
Hello,

I'm trying to figure out if it's possible to show the content of one column of a dataset in all of the cells of a dbgrid.
The idea is continue on the second column when the visible rows at the bottom of a form are filled. This way the user has an overview of all the content of a given dataset column.
Currently I can only achieve this by using a stringgrid, but I'd like to know if this is possible with a dbgrid.

BR
Tony

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Showing one datafield across a whole dbgrid
« Reply #1 on: October 04, 2014, 05:51:10 pm »
Hello,

I'm trying to figure out if it's possible to show the content of one column of a dataset in all of the cells of a dbgrid.
The idea is continue on the second column when the visible rows at the bottom of a form are filled. This way the user has an overview of all the content of a given dataset column.
Currently I can only achieve this by using a stringgrid, but I'd like to know if this is possible with a dbgrid.

BR
Tony

No, what you describe is a vertical grid although the design has been around for years the end result is that it is not used very much making the end result a bit of the weird kid on the block.

 
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Showing one datafield across a whole dbgrid
« Reply #2 on: October 05, 2014, 02:30:50 pm »
Tony,

Any chance you can post an image of your results with a tstringgrid?

The object inspector in Lazarus is an example of a vertical grid, but I am not sure thats what you are describing.
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

corpusgemini

  • New Member
  • *
  • Posts: 19
Re: Showing one datafield across a whole dbgrid
« Reply #3 on: October 12, 2014, 01:49:52 pm »
Hello Mike,

Thanks for paying attention to this.

Actually I was describing something else. What I'm trying to do is loosely based on iTunes' Album view: a picture with the ability to drag it to somewhere else. Safari has something similar when opening a new tab and it displays your Top Sites.
My data is coming from a SQL query and should be displayed in the same way: picture and optional text, and the user can drag the picture.

I hope this makes things more clear.

Right now I am using a TStringrid to position the pictures, using the CellRect function, but it's quite a hassle when the window gets resized.

Best regards,
Tony

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Showing one datafield across a whole dbgrid
« Reply #4 on: October 15, 2014, 01:58:28 pm »
Sorry, I'm neither an iTunes or a Safari user, and can't picture what you're describing. 

Google finds me
http://www.macworld.com/article/2020708/understanding-the-new-views-in-itunes-11.html
http://core0.staticworld.net/images/article/2012/12/albums-view-2-100017933-orig.png

Is the image in the second link the one you're trying to reproduce?

If it is, I wouldn't be trying to implement that as a single control. Personally I'd implement the album art along the top in a TListView (view style = vsIcons), and the related data in it's own grid.   I'd then add some code in to synchronise the contents of the second grid to the primary TListView. 

Implementing that entire view in a single grid would get...  problematic.   I have no idea how to scroll the top row independently to the other rows for a start...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

 

TinyPortal © 2005-2018