Board index » delphi » DBGrid Selection Problem

DBGrid Selection Problem


2003-07-24 02:15:41 AM
delphi24
Hello Newsgroup!
I use a DBGrid with an OnDrawdatacell to color some columns and the selected
row. If I requery the database the DBGrid indicator in the first column and
the selected row (highlighted by my OnDrawdatacell) do not match. If I do
not use OnDrawdatacell everything works fine.
Is it necessary to refresh, repaint, etc. the DBGrid after using
OnDrawdatacell?
Thanks for any help!
Bye, Sebastian Tengler
 
 

Re:DBGrid Selection Problem

Quote
Try using the OnDrawColumnCell instead.
Tried that one. But it comes up with the same result. Sometimes the
indicator and the selected row do not match.
Any other ideas?
Thanks, Sebastian Tengler
 

Re:DBGrid Selection Problem

Sebastian Tengler writes:
Quote
>Try using the OnDrawColumnCell instead.

Tried that one. But it comes up with the same result. Sometimes the
indicator and the selected row do not match.
Let's see your code for the method. It should always work as long as you are
testing the State correctly.
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: www.logicfundamentals.com/RADBooks/delphibooks.html
Those who disdain wealth as a worthy goal for an individual or a
society seem not to realize that wealth is the only thing that can
prevent poverty. - Thomas Sowell