Forum > Databases
Intercept DBGrid OnColumnMove
daveinhull:
Hi,
I'd like to intercept the OnColumnMove event in a DBGrid, and have been reading up about Main Loop Hooks and AddEventHandler which is the way I think I need to do this. I've tried searching for some example, but can't find anything, does anyone have a pointer to some examples or a tutorial.
Just for background, I'm trying to write a set of routines that adds a dropdown filter button to the title columns in a DBGrid, so I don't just want to add my own routine to the OnColmnMoved or OnColumnSized, as the developer (me typical) may also want to use these events for other things.
Also on a similar note, does OnColumnMoved get fired after the columns have moved (as the name would suggest) or before - from what I can see it is before as everything in the grid appears the same.
Thanks in advance
Dave
lucamar:
The OnColumnMoved event is published: You can set it in the Object Inspector or assign it in code like any other event.
daveinhull:
Thanks lucamar,
I realize that I can set a routine through the Object Inspector or through code , but I was interested in traping the event before it gets to that point. I wanted to do something in a general routine before passing the execution to that routine (if there is one).
Any thoughts
Dave
lucamar:
Oh, ok. Only thing that I can think at the moment is to dive into the source and see where and in response to what message (if any) or condition it's being called. Once you know that you can ascertain where and how intercept it. You may have to subclass it, though.
I'll give it a look a little later (or tomorrow!).
daveinhull:
Hey lucamar many thanks, but please don't spend too long on it, but any clues to help are most welcome :)
I thought I could do it by using the AddEventHandler, but I'll see if I can navigate my way through the source code as well, although it may be a little tricky for a 1980's DEC VAR Pascal programmer :o
Navigation
[0] Message Index
[#] Next page