Board index » delphi » TDBGrid Selected Row

TDBGrid Selected Row


2005-06-16 11:08:21 PM
delphi166
Is it possible to find out if a row has been selected in a TDBGrid if
the grid doesn't have dgMultiSelect=True and dgAlwaysShowSelection=False?
 
 

Re:TDBGrid Selected Row

srdaniel writes:
Quote
Is it possible to find out if a row has been selected in a TDBGrid if
the grid doesn't have dgMultiSelect=True and
dgAlwaysShowSelection=False?
If multi-select is off and the dataset is not empty then the current
record is always "selected."
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
 

Re:TDBGrid Selected Row

Craig Stuntz [TeamB] writes:
Quote
srdaniel writes:


>Is it possible to find out if a row has been selected in a TDBGrid if
>the grid doesn't have dgMultiSelect=True and
>dgAlwaysShowSelection=False?


If multi-select is off and the dataset is not empty then the current
record is always "selected."

I thought I posted this in database general group. Anyway, yes I know
the current record is always "selected" but it is not always highlighted
in the grid itself. If the grid loses focus, then the current record is
still "selected" but not highlighted. I guess Screen.ActiveControl is
just as good.