Deriving from built-in DataGrid control

A

Axel Dahmen

I've created a class in a .NET 1.1 C# class library project deriving from
System.Web.UI.WebControls.DataGrid. When I try to use this class in my .aspx
page, I get loads of parser warnings in the Task pane telling me that e.g.
<HeaderStyle> is not supported by the active schema. This is true for any
DataGrid "sub control" I'm using.

Is there an easy way to get rid of these warnings?

TIA,
Axel Dahmen

------------
This is my class:

public class SortingDataGrid : System.Web.UI.WebControls.DataGrid
{
...
}

------------
This is what I've added to the .aspx page (HeaderStyle and PagerStyle are
underlined in red):

<%@ Register TagPrefix="exc" Namespace="Common.Controls" Assembly="Common"
%>

....

<exc:SortingDataGrid Runat="server" ID="grdTemp" ...>
<HeaderStyle .../>
<PagerStyle .../>
...
<exc:SortingDataGrid/>
 
S

Steven Cheng[MSFT]

Hi Axel,

Welcome to the ASPNET newsgroup.

Regarding on the custom webcontrol, I think the warning you encountered in
IDE is the design-time xml schema warning. As for VS IDE it will validate
the control's markup in the aspx file. And for built-in controls, there has
built-in schemas associated with them( for vs 2003, it is stored in the
following localtion:
C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Packages\schemas\xml
)

And for our custom controls, since there is no schema associated with them,
IDE will failed to validate the markup and report some warning. You can
just ignore it since that doesn't affect runtime behavior. However, if you
do want to add design-time support on the schema for custom control, you
can have a look at the following msdn article which discussing on
design-time support for custom web server controls:

#Adding Design-Time Support to ASP.NET Controls
http://msdn.microsoft.com/library/en-us/dnaspp/html/ASPNet-AddDesignTimeSupp
ort.asp?frame=true

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top