Board index » delphi » TDBGrid selection

TDBGrid selection

If I'm editing a record in a TDBGrid how can I programmatically set focus
to a field in the record (i.e. a TDBGrid column)??

Case in point, I want to validate user input so in the OnColExit event I
test the user input for the currently selected field. If it's invalid, I
use the Perform method to send a message to myself informing me that I need
to set focus to the field that the user just exited. I cannot use picture
masks or the like.

I goofed around with TDBGrid.SelectedIndex but had no luck.

Any suggestions?

Paul

 

Re:TDBGrid selection


On 29 Apr 1997 04:24:18 GMT, "Paul Hazlett" <phazl...@gate.net> wrote:

Quote
>If I'm editing a record in a TDBGrid how can I programmatically set focus
>to a field in the record (i.e. a TDBGrid column)??

>Case in point, I want to validate user input so in the OnColExit event I
>test the user input for the currently selected field. If it's invalid, I
>use the Perform method to send a message to myself informing me that I need
>to set focus to the field that the user just exited. I cannot use picture
>masks or the like.

>I goofed around with TDBGrid.SelectedIndex but had no luck.

>Any suggestions?

>Paul

goto the desired record, then use grdWhatever.SelectRecord. This sets
the current record as selected (hilighted).

        Dana

Other Threads