DisplayFormat and DBgrid

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
nlanger
Junior Boarder
Junior Boarder
Posts: 27
Joined: 14.10.2020, 21:56

DisplayFormat and DBgrid

Post by nlanger »

I have a strange effect.

If the ZQuery is opened and the display format is set for a DateTime field and the DateTime field is empty in the first record, the focus in the DBgrid is drawn incorrectly. The internal data record pointer was probably changed by "DisplayFormat" ?

See attachement

The focus is on the first sentence with a date. The record pointer is on record 1.

Norbert
You do not have the required permissions to view the files attached to this post.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: DisplayFormat and DBgrid

Post by marsupilami »

Hello Norbert,

I can confirm the problem on Delphi XE7. This doesn't happen on Lazarus. I also did the same thing with FireDAC and ODBC using SQL Native Client. It didn't happen there.
Bu then - I am not sure - how does DBGrid decide where to draw the focussed cell and where to draw the triangle? Usually I would expect the DBGrid to keep these things in sync?

Best regards,

Jan
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: DisplayFormat and DBgrid

Post by Fr0sT »

marsupilami wrote: 27.07.2022, 16:20 Bu then - I am not sure - how does DBGrid decide where to draw the focussed cell and where to draw the triangle? Usually I would expect the DBGrid to keep these things in sync?
Nope. It's the dumbest feature of vanilla dbgrid IMHO and it lasts from the very beginning.
nlanger
Junior Boarder
Junior Boarder
Posts: 27
Joined: 14.10.2020, 21:56

Re: DisplayFormat and DBgrid

Post by nlanger »

I'm running Delphi 10.4 and this only happens with ZQuery.
This does not happen with the FireDAC query or any other query.
I also often use the RxMemoryTable, and this effect does not occur there either.

Something is misaligned when setting "DisplayFormat". Does the ZQuery look for the first record where the format can be applied?

Norbert
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: DisplayFormat and DBgrid

Post by marsupilami »

Fr0sT wrote: 28.07.2022, 08:22
marsupilami wrote: 27.07.2022, 16:20 Bu then - I am not sure - how does DBGrid decide where to draw the focussed cell and where to draw the triangle? Usually I would expect the DBGrid to keep these things in sync?
Nope. It's the dumbest feature of vanilla dbgrid IMHO and it lasts from the very beginning.
Do you know how this happens? What makes DBGrid do this?
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: DisplayFormat and DBgrid

Post by marsupilami »

nlanger wrote: 28.07.2022, 15:51 Something is misaligned when setting "DisplayFormat". Does the ZQuery look for the first record where the format can be applied?
Even if it does, if TZQuery moves to another record, I would expect DBGrid to synchronize to it correctly.
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: DisplayFormat and DBgrid

Post by Fr0sT »

marsupilami wrote: 29.07.2022, 08:33 Do you know how this happens? What makes DBGrid do this?
No, the described case is surprise for me, I'm just saying that for DBGrid it's normal to have dataset cursor and focused cell indicator non-synced
Post Reply