Andrus,
>Thank you. It works.
>But how to close form from DataGrid ProcessCmdKey() method?Well, just off the top of my head, I'd say that you could put a MyParentForm property on your Grid sub-class and when you drop your grid on a form, remember to set that property. Then you can call the MyParentForm.Close() method. That should do the trick.
~~Bonnie
>>Hi Andrus,
>>
>>Basically, you have to override the ProcessCmdKey method in your DataGrid sub-class ... see this article for more information:
>>
>>
http://www.codeproject.com/cs/database/DatabaseAcessWithAdoNet1.asp#Keystrokes>
>Thank you. It works.
>But how to close form from DataGrid ProcessCmdKey() method?
>
>I used
>((Form)this.Parent.Parent.Parent) .Close();
>
>
>If grid is not placed in tabpage then this code does not work.
>How to find grid parent form ?
>In Visual FoxPro this is easy becauses VFP has thisform
>
>However, DataGrid does not have parentform property.