Home > Back-end >  Questions about the assignment of cell in the DBGRID?
Questions about the assignment of cell in the DBGRID?

Time:10-01

Because the computer operating system upgrade from 32-bit to 64 - bit, my DELPHI version also from DELPHI 7 upgrade to XE3, there have been some problems in the operation DBGRID, thinking for a long time have not been solved, Posting to consult everybody,
Because the data in the database in the writing process is encrypted, so at the time of query according to need to decrypt,
So I rewrite the DBGRID DrawColumnCell events, the following code
 
//define rewrite event
Procedure DrawDataCell (const the Rect: TRect; Field: TField; State: TGridDrawState); Override.
//time to rewrite the code
Procedure TDBGRID. DrawDataCell (const the Rect: TRect; Field: TField; State: TGridDrawState);
The begin
Canvas. TextRect (the Rect, the Rect. Left + 2, the Rect. Top + 2, decryption (Column. Field. AsString) are identical);
end;

The fault code in DEELPHI 7 run there is no problem,
The problems in XE3:
After the data query, display is normal; But as DBGRID cell, in the database of data: the Column. The Field. The AsString, and decrypted Column. Field. The AsString repeat together, according to the result data showed normal,
In general is:
The focused hopefully can not normal, according to data for the Column. The Field. The AsString and decrypted Column. The Field. The AsString overlap, according to
Loses focus of cell data back to normal again, show decrypted Column. Field. AsString,
  • Related