|
 |
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 .
|
 |
|
|
 |

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
|
|
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.
|

December 10th, 2004, 11:21 AM
|
Authorized User
|
|
Join Date: Nov 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

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
|
|
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.
|

January 11th, 2005, 11:09 AM
|
 |
Friend of Wrox
Points: 16,481, Level: 55 |
|
|
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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.
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |