Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Common methods for different objects
Message
From
21/05/2009 04:14:38
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01400964
Message ID:
01401206
Views:
35
>>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform