tgbs 16 Posted May 13, 2022 (edited) If there is an invisible column, the name of the next column that is not fully visible is not drawn If Second column is visible = false then This can be seen in the design time as well Delphi Alexandria with the update Edited May 13, 2022 by tgbs Share this post Link to post
Stano 143 Posted May 13, 2022 You forgot one piece of information. What a component it is. Share this post Link to post
aehimself 399 Posted May 13, 2022 TDBGrid is doing a really crappy job in sizing it's columns and however I didn't meet the issue you describe, I simply consider it to this "feature". Have a look at this snipplet for a possible fix; I started mine based on this too. Share this post Link to post
aehimself 399 Posted May 31, 2022 (edited) I wanted to do this for a really long time so I started to extract the core improvements of Delphi's TDBGrid into a separate component. This includes: - New public BeginUpdate / EndUpdate methods, which can disconnect the dataset and keep the previous image on the component. This is useful if you are doing opens / posts / anything in a background thread but don't want to show emptiness until - Automatic and manual fitting of columns which considers the column and the content width but won't let a column be wider than half it's size - Vertical scrollbar now works properly, not only 3 positions and is not visible when not needed - Grid properly handles mouse wheel scrolling - Content is shown as the scrollbar is dragged (not only updating when the mouse is released) - If there is no connected dataset or it is not active, the two empty cells won't be shown - Every second row has a slightly different background, out-of-focus selection is now drawn with a separate shade of grey, so you can see that the grid is not in focus. This considers VCL styles. - If TitleClick or TitleHotTrack is enabled, the cursor changes to a hand instead of the pointers It might get more updates later on when I see what code can be generally used from my heavily customized one. Feel free to grab it / check how things were done. Tried to put comments everywhere. Edited May 31, 2022 by aehimself 2 Share this post Link to post