|
-
Jul 8th, 2008, 07:45 AM
#1
Thread Starter
Hyperactive Member
[2005] Inheritance Question
I am inheriting properties from Developer Express (www.devexpress.com) controls - And they're are two types of controls that have the same functionality but they are on two different levels -
What I am talking about is a DateEdit, and a RepositoryItemDateEdit - The DateEdit.Properties has all of the features of the RepositoryItemDateEdit - but the RepositoryItemDateEdit does not have the DateEdit's features -
Where I need help is that in a GridControl, you can only use a RepositoryItemDateEdit as an editor - and not the DateEdit control. Is there a way to have my object inherit one or the other? and just check for the type - Or do I have to do dual both of them, and make sure they match -
I'm trying to get the best way to complete this task - any help would be great - Thanks
-
Jul 8th, 2008, 07:51 AM
#2
Frenzied Member
Re: [2005] Inheritance Question
Why not inherent both of them? Then you have one "super" control.
-
Jul 8th, 2008, 08:08 AM
#3
Re: [2005] Inheritance Question
.NET only supports single inheritance. When you define a class you can choose one base class and one base class only.
-
Jul 8th, 2008, 08:10 AM
#4
Thread Starter
Hyperactive Member
Re: [2005] Inheritance Question
Got any suggestions so I would not have to dual both classes when making changes ?
Would it make sense to have the two separate classes (controls) and then have them bring in functions / subroutines from another mutual class - which has the shared functionality ?
-
Jul 8th, 2008, 08:29 AM
#5
Frenzied Member
Re: [2005] Inheritance Question
@jmcilhinney: Yes that is true but can the user defined class not be used as a base class to further inherit more features? forgive me if this is wrong but i thought this is possible.
-
Jul 8th, 2008, 06:23 PM
#6
Re: [2005] Inheritance Question
You basically have two choices as far as I can see:
1. Inherit both classes separately.
2. Inherit one class and then add the extra functionality of the other yourself.
-
Jul 8th, 2008, 08:20 PM
#7
Re: [2005] Inheritance Question
If you want C to inherit A and B in .Net, then you make B inherit A, and C inherit B.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|