>>>Is there a way to send keypress keys to the underlying grid record?
>>>i.e. If a user were to press a CTRL-D combination for example, this could mean display a screen for a user to pick a value from...
>>>
>>>This would need to be at the grid level as in the base class no columns have been defined. I have a routine that when the grid initializes, the columns are created, control sources are set etc. To do the above, I think I would want to do it at the grid level. my grid base class has a method called buildgrid which is where I put the setup code as described above. I have a second method that called setgrid which serts up column widths etc.
>>>
>>>I hope this explains what i am trying to do.
>>>
>>>Mike
>>
>>Mike,
>>There are several solutions to the problem. One of them is form.keypreview = .t.
>>Cetin
> I am using this already for some simple navigation controls.. i.e. CTRL-N = Next, CTRL - P Previous etc. How do I integrate CTRL-INS and CTRL-DEL for functionality in the grid... and only affect the grid...
>i.e. is there a programatically way to determine if the grid has the focus... Maybe I need a property set in the grid, when it gets the focus and it reverts to false when the grid does loses the focus? Or is there a better way?
>
>TIA,
>Mike
Mike,
You can use ActiveControl to determine if it's a grid. Or you can use a broadcast system (as I call it). ie:
lparameters vNewVal
oInfo = createobject('Empty')
addproperty(oInfo, 'Caller', this)
addproperty(oInfo, 'Method', 'KeyPress')
addproperty(oInfo, 'nKeyCode', m.nKeyCode)
this.SetAll("BroadCast", oInfo)
There are other ways like BindEvent(), using your own controls within grid etc.
Cetin