By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,563 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,563 IT Pros & Developers. It's quick & easy.

custom control - reference to contained elements in inherited class

P: n/a
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.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Grids

<ParseChildren(True)> Public Class DefaultGrid

Inherits DataGrid

Public Sub New()
PagerStyle.Mode = PagerMode.NumericPages
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="testDefaultGrid.aspx.vb" Inherits="test2.WebForm2"%>
<%@ Register TagPrefix="cc1" Namespace="MyControls.Grids"
Assembly="MyControls" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>Testing DefaultGrid</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
<BODY bgColor="ivory">
<h2>Testing the DefaultGrid Control</h2>
<form id="Form1" method="post" runat="server">
<cc1:DefaultGrid id="DefaultGrid1" AllowPaging="true"
OnPageIndexChanged="PageChanged" AllowSorting="True"
OnSortCommand="SortByColumn" runat="server"></cc1:DefaultGrid>

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:BoundColumn>) 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
Share this Question
Share on Google+
1 Reply

P: n/a

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 ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.