Deriving from built-in DataGrid control

Discussion in 'ASP .Net Web Controls' started by Axel Dahmen, Apr 26, 2006.

  1. Axel Dahmen

    Axel Dahmen Guest

    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/>
    Axel Dahmen, Apr 26, 2006
    #1
    1. Advertising

  2. 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.)
    Steven Cheng[MSFT], Apr 27, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lisa Calla

    deriving from textbox control

    Lisa Calla, Oct 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,599
    Lisa Calla
    Oct 22, 2004
  2. Pierre Rouleau
    Replies:
    2
    Views:
    322
    Pierre Rouleau
    Apr 22, 2005
  3. Fred Hirschfeld
    Replies:
    2
    Views:
    182
    Fred Hirschfeld
    Apr 21, 2004
  4. Itaichuk

    Deriving a Composite Control from a User Control

    Itaichuk, Oct 13, 2007, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    726
    Itaichuk
    Oct 13, 2007
  5. Secret Squirrel

    deriving from datagrid and adding other controls too

    Secret Squirrel, Feb 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    135
    MasterGaurav
    Feb 25, 2005
Loading...

Share This Page