TaKo91 0 Posted May 15 I have a TFDQuery that returns a row from record. When binding it visually to TStringGrid is it possible to invert it, so the field names are displayed in rows and values in columns? I would like to do the same for TFDTable when visually binding it to TStringGrid. Id | Name | Role Id | 1 | 2 1 | John | admin -> Name | John | Jane 2 | Jane | user Role | admin | user Share this post Link to post
Lars Fosdal 1791 Posted May 15 It is not too complex to write the classes required to handle this, and decide how to orientate rows vs columns. I did that for TMS TAdvStringGrid, where I first collect the data into a matrix (by column, then by row), then stuff the content into the grid in the orientation I prefer, automatically setting up the grid props, handling rows, cols, width sizing as well as titles, etc. The matrix can be filled from a database query, or from a list of objects, or by code. I wish I had time to do a rewrite for TStringGrid, as the lib has too much proprietary code to share as is. Share this post Link to post