473,796 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

custom control - reference to contained elements in inherited class

I am trying to build a custom web control based on DataGrid using VS.NET
Standard Edition and have a problem referencing the Columns collection.

The control has been built in a separate VS.NET solution/project called
MyControls. The following is a cut down version:
Imports System
Imports System.Collecti ons
Imports System.Componen tModel
Imports System.Drawing
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.W ebControls

Namespace Grids

<ParseChildren( True)> Public Class DefaultGrid

Inherits DataGrid

Public Sub New()
PagerStyle.Mode = PagerMode.Numer icPages
..
..
End Sub
End Class
End Namespace

In my test project, I have added the control into the toolbox and dragged it
onto a Web form called testDefaultGrid which is as follows:

<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="tes tDefaultGrid.as px.vb" Inherits="test2 .WebForm2"%>
<%@ Register TagPrefix="cc1" Namespace="MyCo ntrols.Grids"
Assembly="MyCon trols" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Testin g DefaultGrid</title>
<meta name="GENERATOR " content="Micros oft Visual Studio.NET 7.0">
<meta name="CODE_LANG UAGE" content="Visual Basic 7.0">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie6">
</HEAD>
<BODY bgColor="ivory" >
<h2>Testing the DefaultGrid Control</h2>
<form id="Form1" method="post" runat="server">
<cc1:DefaultGri d id="DefaultGrid 1" AllowPaging="tr ue"
OnPageIndexChan ged="PageChange d" AllowSorting="T rue"
OnSortCommand=" SortByColumn" runat="server"> </cc1:DefaultGrid >
</form>
</BODY>
</HTML>

I handle the paging and sorting events in a code behind and all this works
fine. However, if I try to insert <Columns> (and tags like
<asp:BoundColum n>) inside the <cc1:Default Grid>, in the same way as I can
with the standard DataGrid, VS.NET says that the active schema does not
support the element 'Columns'.

I suspect that there is some bit of referencing that is not provided
automatically in VS.NET Standard but is in the control library support in
other editions. Can anyone give me a clue here on what I need to do to fix
this (other than upgrading)?

Jon Stranger
Nov 17 '05 #1
1 1574
Hi,

You got this error because your name space isn’t declared in asp.xsd
schema. Alter the schema (lot of work) or live with it. Beside this
error every thing supposes to work fine.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1485
by: microdevsolutions | last post by:
Hello I am using ASP.NET - I have written a Custom Control (to output some information) that has a public property declared. I have a user control that is a wrapper around the above custom control. The code behind is nothing more than what is generated. The ascx is :- <%@ Control Language="vb" AutoEventWireup="false"
6
2440
by: Christian H | last post by:
Hi! I've created a custom control (myDrawControl) that deals with drawing. This control is then added to a form( myMainForm) Now, whenever something is dragged and dropped onto myDrawControl , I want to update a variable in myMainForm that keeps track of the objects that have been added.(ArrayList objectsAdded) Now I'm a little confused... How can I do this, when the method that deals
8
3081
by: TS | last post by:
I am trying to get set a property of a control on the inherited class from base class. I imagine i have to use reflection, so could someone give me the code to do it? something like this? this.GetType().GetMember("panel1").SetValue(xx).Left = 44;
3
2865
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and creating elements on the fly dynamically. I have a control that needs to display 3 columns and n number of rows depending on number of records. Sounds simple. But each Row has a control with its own data source binding and value must be selected...
4
1818
by: Michael Slattery | last post by:
Hello... although I've found several posts in reguards to this topic, I don't seem to understand the solution... When I derive a class from my base class and then serialize using XMLSerializer, I do not see the properties of the base class. Project 1 - Class Library Public Class nameBase {
0
1060
by: Esha | last post by:
I'm trying to create a compisite Windows custom control. When I create Inherited control with the name, let's say MyLabel and use Inherits System.Windows.Label, then when I place my control on the Windows form, the default value for Text property is set to MyLabel1, MyLabel2 and so on. When I create Composite control and place there for instance Label control then I have always Label1 displayed. There is no property Text. I can create it...
3
1318
by: Cyr1dian | last post by:
Hi, My problem is that a custom control "newA" that inherits from a base custom control "baseA" is not displaying any contained controls - that were not inherited - at run time, but displays them fine at design time. I'll give a short example: public class baseA: UserControl
3
2317
by: JJ | last post by:
Whats the best way to convert a user control to a custom server control? i.e. I created a .aspx control using the designer to create the look of the control. I now want to use this in other projects and compile it as a dll. However, I understand that I now need to create the controls interface elements via code. Is there a way to easily translate a previously created interface to be created by code? Not sure I am making myself very...
1
3737
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a custom control, and want to derive a second control from that control. public class CustomButton : Button { } public class SpecialCustomButton : CustomButton
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9529
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.