Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TDBCtrlGrid not displaying selected row, nor calling OnPaintPanel



Permlink Replies: 2 - Last Post: Oct 28, 2016 12:28 PM Last Post By: Valence Crearer
Valence Crearer

Posts: 64
Registered: 11/27/99
TDBCtrlGrid not displaying selected row, nor calling OnPaintPanel
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 6:52 AM
Having trouble recreating this, but,

TDBCtrlGrid is sometimes calling the OnPaintPanel and sometimes not.

For the one working on my form, it is the primary(master) that controls all the others. the dependents display records related to the first. Dependents do not highlight (use selected color) and do not call OnPiantPanel.

In debugging this I've found that in the paint handle, FControls is not nil in the ones that do not work, FControls is nil in the one that does work. When FControls is nil, the code calls PaintWindow(DC) and this goes up to the TDBCtrlGrid::PaintWindow, but instead when FControls is not nil, the code excludes regions, then calls PaintControls(DC,nil). This shows the controls in each, but does not draw the frame around them, nor does it color the background with the SelectedColor.

Why is FControls nil on the one that works? (Odd since it does contain controls?) Why is it not nil on the ones that don't work?

This code (exactly as is) worked under XE7.
Valence Crearer

Posts: 64
Registered: 11/27/99
Re: TDBCtrlGrid not displaying selected row, nor calling OnPaintPanel
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 11:47 AM   in response to: Valence Crearer in response to: Valence Crearer
Further information:

There are multiple TDBText boxes that are aligned in the TDBCtrlGrids that are not working.
If I do not alClient the last one, then the problem goes away. When I alClient the last one, the problem arises.

For now... That's it..
Valence Crearer

Posts: 64
Registered: 11/27/99
Re: TDBCtrlGrid not displaying selected row, nor calling OnPaintPanel
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 12:28 PM   in response to: Valence Crearer in response to: Valence Crearer

This code (exactly as is) worked under XE7.

More information still:

Align now hides the boarders.
When alClient is combined with !AlignWithMargins the entire boarder is obscured. If the entire boarder is obscured, then it would seem that OnPaintPanel is not called, nor is SelectedColor applied in some cases. Perhaps this is an optimization that works well for objects that are not transparent?

Can anyone replicate? I have one production app that this is doing this, but I have a test app that I will use to show a minimal case if this is in error. That app works fine with Align==alClient and !AlignWithMargins. Wierd. I'm still having a tough time replicating it in a seperate application, but no problem, I can just use AlignWithMargins in the broken app.

Odd.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02