Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close form with esc key in Datagrid
Message
De
25/11/2006 12:54:13
 
 
À
22/11/2006 13:55:09
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
Divers
Thread ID:
01171053
Message ID:
01172412
Vues:
11
This message has been marked as the solution to the initial question of the thread.
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.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform