Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 9th, 2004, 10:27 AM
Registered User
 
Join Date: Oct 2004
Location: evenyehuda, , Israel.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default User Control Inheritence.

Hellow.

General:
I'm developing asp.net application.
I need to write several properties that are common to
all control types : datagrid,checkbox,button...ecxt.

problem:
[u]option A:</u>
should i inherit a control from System.Web.UI.UserControl
and then inherit again for each type.
for example:
1. MyBaseControl:System.Web.UI.UserControl.
2. MyDataGrid:MyBaseControl.
3. Place a DataGrid on it.
and repeat step 2,3 for each control type ?

[u]Option B</u>
Inherit diractly : MyDataGrid from DataGrid,MyCheckBox from CheckBox....

Please help..
Thanks inadvance.
Racheli.

Reply With Quote
  #2 (permalink)  
Old December 10th, 2004, 11:21 AM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you want just to extend the existing functionality of a control, I think option B is right way to go.

checkout this link to see how datagrid can be extended if you need..

http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Hope it helps
Reply With Quote
  #3 (permalink)  
Old December 24th, 2004, 06:07 PM
Registered User
 
Join Date: Oct 2004
Location: evenyehuda, , Israel.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi.
[u]General </u>
I inherited datagrid from : System.Web.UI.WebControls.DataGrid.
I have added "Register" tag and put my Datagrid on the page. it look like: <cc1:MyDatagridControl></cc1:MyDatagridControl>
.
[u]Problem</u>
I am tring to add ItemTemplate column or any one of the embeded tags
of Asp:DataGrid Controle.
I accept Error[u]:The active schema does not support the element ItemTemplate'</u>

Please help.
do i have to implements method in the inherited class?

THANKS INADVANCE Racheli.

Reply With Quote
  #4 (permalink)  
Old January 11th, 2005, 11:09 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

As far as Visual Studio is concerned it doesn't recognize "cc1:MyDatagridControl" as anything meanful to the intellisense logic. But you can use the standard datagrid markup for columns and settings as long as your control is inherited from the standard datagrid control. There may be ways to change this so that visual studio recognizes your control, but I've never played with it. When I'm setting up my markup I usually just create a regular datagrid so I can get the intellisense then just copy over the markup to my custom control.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inheritence with System.object class NeoNeo C# 2 May 24th, 2006 06:38 AM
Inheritence with System.object class NeoNeo BOOK: Professional C#, 2nd and 3rd Editions 0 May 23rd, 2006 12:59 PM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
Help! Custom Server Control using User Control diehard ASP.NET 1.0 and 1.1 Professional 2 January 4th, 2006 12:33 PM
Help with control initialization in user control mike_remember ASP.NET 1.0 and 1.1 Professional 7 December 19th, 2005 11:08 AM



All times are GMT -4. The time now is 11:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.