Information générale
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Network:
Windows 2003 Server
>>>>Hi,
>>>>
>>>>I suggested the first. Thought of suggesting the second. But I'm not sure about using an Extension method.
>>>>I know it would work but MS seem to recommend against them when there are alternatives.
>>>>Great if you don't have access to the source of the targeted class but, in the end, they are really just syntatic sugar?
>>>>Best,
>>>>Viv
>>>>
>>>Viv,
>>>
>>>Can you show some simple sample of a class based on some control, most preferrable DataGrid? I need to know how to add methods to the class definition.
>>>
>>>Thanks in advance.
>>
>>Sorry, way to late here - I'll post in the A.M.
>
>Well, too bad, guys :(((((((( I created the class, changed the form to use the classes - new properties - and now I hit the stone wall. The form designer wants to add
>
>((System.ComponentModel.ISupportInitialize)(this.grdOrderItems)).BeginInit();
> ((System.ComponentModel.ISupportInitialize)(this.grdSearch)).BeginInit();
> ((System.ComponentModel.ISupportInitialize)(this.grdOrderDetails)).BeginInit();
>
>and the DataGrid class doesn't implement this interface.
>
>I will have to go back to the default class, add the properties back to the main form rather than to the grid class, re-code everything again...
>
>Sounded like a good idea to use a custom class - but VS makes it too hard :((((
System.Windows.Forms.DataGrid implements ISupportInitialize. Assuming in the lines above that grdOrderItems,grdSearch and grdOrderDetails derive from that class then they should be OK . Just tried this with no problem. What error are you getting?
Regards,
Viv
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement