Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading the row from a DBGrid

66 views
Skip to first unread message

Kjell Hansen

unread,
Aug 1, 1999, 3:00:00 AM8/1/99
to
Hi,
In order to sort my DBGrid I need to detect if the top row is being
double clicked, simple just read the Row property I thought, but it's
not there. It's a protected property of TCustomGrid, but I can't reach
it.

Any ideas?
TIA
Kjell Hansen


Ed Hochman

unread,
Aug 1, 1999, 3:00:00 AM8/1/99
to
Hi,

dbGrid has an OnTitleClick event which is what you sound like you're
looking for.

As I recall, this was added in D4, so if you have an earlier version...

Also, you might want to take a look at TGXDBGrid at
http://www.gexperts.com/. It has much better handling of the title row
including: Titles can actually look like buttons when clicked on, Titles
can have a glyph such as to indicate which column is being sorted and if
it's ascending or descending, and much, much more. And it's free.

HTH, Ed


--
Ed Hochman - MBH Systems

Ecostats

unread,
Aug 1, 1999, 3:00:00 AM8/1/99
to
OnTitleClick is in D3

--
Ecological Software Solutions
http://www.ecostats.com

**** Remove Spam Block To Respond Directly ****

Kjell Hansen

unread,
Aug 2, 1999, 3:00:00 AM8/2/99
to
Hi Ed,
yeah, I found the On TitleClick, but I'm interested in acting on a double
click on the Title...
And another fenomena is that I can't get the Fieldname of the column (sic!).
SelectedField returns the caption of the column, and so does the other
functions (FieldName, Origin, FullName etc). I get the correct FieldIndex but
that's not sortable in Access, ORDER BY 1 ASC isn't supported by Jet :(

More ideas, anyone?
/Kjell

Ed Hochman

unread,
Aug 2, 1999, 3:00:00 AM8/2/99
to
Hi,

OnTitleClick returns Column as it's only parameter.

Column.FieldName should give you the field name, not the title caption.

HTH,

Ed


kjell....@telia.com (Kjell Hansen) wrote in
<37A5BF35...@telia.com>:

>SelectedField returns the caption of the column, and so does the other
>functions (FieldName, Origin, FullName etc). I get the correct
>FieldIndex but that's not sortable in Access, ORDER BY 1 ASC isn't
>supported by Jet :(
>

Kjell Hansen

unread,
Aug 2, 1999, 3:00:00 AM8/2/99
to
Hi Ed,
It might, I used the Index property of it and perform a case of depending
on the column#, in that way I can use it even from a speedbutton reading
the grid column index.
And I simulate a dblclick with the help of GetTickCount and
GetDoubleClickTime and a local variable.

So most of my current problems in that form are solved :)

Still, many thanks for your efforts
/Kjell

0 new messages