Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling grids - losing focus

Status
Not open for further replies.

Raccoon

Programmer
Aug 18, 1999
92
0
0
US
When I leave a grid I want to go to a particular object. I can not set focus from a click or valid statement. I do not see a lost focus method in the grid properties. Am I just missing it? If not, how do I control where the focus goes when leaving it. Changing tab order does not seem to be the answer.

Thanks

Mike
 
Racoon

You can set focus from a click event. Or are you saying you don't want to use the click?
What object has focus just before you need to set focus on the grid? You could use the LostFocus event of that object.
 
Maybe I'm not sure about sequence of events.

If I put a setfocus() in my grid.click, does the valid statement still execute?

I have a text box that updates a grid as I type in it. When I get enough of a name to get close to the right one, the user clicks on the grid, scrolls up or down until the name they want appears, and hit enter or click on it (they might do either, you know how users are).

The valid statement is setting things up to return to the main controls, for instance, changing index order, table selected, etc... It needs to execute just before focus is lost.

I also do not see a keypress event in the grid, so I can't set focus from it if the user presses enter. If the only set focus command is in the click event, how do I control focus change if the user presses enter?

Thanks
Mike
 
Hi Raccoon,

I don't know exactly what you want, but maybe this will help you:
The gridcontrol is like a container object, it contains default HeaderControls and TextControls. Only on these controls you will find the keyPress, gotFocus and loseFocus events, not the gridControl itself.
In worst case, you have to program each textbox.loseFocus event, or better, create a textboxClass and add it to each gridcolumn you want that specific functionality.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top