deriving from BaseDataList to make a custom datagrid that is 100% client side...

Discussion in 'ASP .Net Building Controls' started by Fred Hirschfeld, Apr 19, 2004.

  1. I want to create a custom datagrid control that uses XML data islands to
    control the data client side with editing. I am trying to inherit the
    minimal for implementing this server control and would like to derive from
    BaseDataList. Does anyone know what I need to put in the two abstract
    methods (CreateControlHierarchy and PrepareControlHierarchy)?

    I know I could resort to the datalist or datagrid and not worry about this
    but I would like to make it as clean as possible.

    Fred
    Fred Hirschfeld, Apr 19, 2004
    #1
    1. Advertising

  2. Re: deriving from BaseDataList to make a custom datagrid that is100% client side...

    > I want to create a custom datagrid control that uses XML data islands to
    > control the data client side with editing. I am trying to inherit the
    > minimal for implementing this server control and would like to derive from
    > BaseDataList. Does anyone know what I need to put in the two abstract
    > methods (CreateControlHierarchy and PrepareControlHierarchy)?


    Fred, the best approach might be to look at how the DataGrid implements
    these methods. Using a disassembler like Reflector
    [http://www.aisto.com/roeder/dotnet/] you can view the source code...

    To summarize very briefly: CreateControlHierarchy() builds up the
    control hierarchy. It creates the controls that makeup the "Items" of
    the data Web control. PrepareControlHierarchy() is invoked during the
    Render phase, and applies the style information (such as ItemStyle,
    AlternatingItemStyle, etc.) to the control hiearchy.

    If you haven't already, I STRONGLY recommend getting and reading from
    cover to cover the book "Developing Microsoft ASP.NET Server Controls
    and Components," by Nikhil Kothari.
    [http://www.4GuysFromRolla.com/ASPScripts/Goto.asp?ID=170] It is an
    invaluable resource for control developers, and explains the purpose of
    these methods as well.

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!
    Scott Mitchell [MVP], Apr 21, 2004
    #2
    1. Advertising

  3. Thanks, I have started looking at this book...

    Fred

    "Scott Mitchell [MVP]" <> wrote in message
    news:7omhc.39192$...
    > > I want to create a custom datagrid control that uses XML data islands to
    > > control the data client side with editing. I am trying to inherit the
    > > minimal for implementing this server control and would like to derive

    from
    > > BaseDataList. Does anyone know what I need to put in the two abstract
    > > methods (CreateControlHierarchy and PrepareControlHierarchy)?

    >
    > Fred, the best approach might be to look at how the DataGrid implements
    > these methods. Using a disassembler like Reflector
    > [http://www.aisto.com/roeder/dotnet/] you can view the source code...
    >
    > To summarize very briefly: CreateControlHierarchy() builds up the
    > control hierarchy. It creates the controls that makeup the "Items" of
    > the data Web control. PrepareControlHierarchy() is invoked during the
    > Render phase, and applies the style information (such as ItemStyle,
    > AlternatingItemStyle, etc.) to the control hiearchy.
    >
    > If you haven't already, I STRONGLY recommend getting and reading from
    > cover to cover the book "Developing Microsoft ASP.NET Server Controls
    > and Components," by Nikhil Kothari.
    > [http://www.4GuysFromRolla.com/ASPScripts/Goto.asp?ID=170] It is an
    > invaluable resource for control developers, and explains the purpose of
    > these methods as well.
    >
    > --
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    > http://www.ASPFAQs.com
    > http://www.ASPMessageboard.com
    >
    > * When you think ASP, think 4GuysFromRolla.com!
    Fred Hirschfeld, Apr 21, 2004
    #3
    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. Dave

    BaseDataList.DataKeys

    Dave, Oct 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    654
    =?Utf-8?B?VGFsZXNwaW5uZXI=?=
    Nov 19, 2004
  2. Boss302
    Replies:
    0
    Views:
    1,029
    Boss302
    Nov 21, 2006
  3. Zoe Hart
    Replies:
    1
    Views:
    356
    Scott Wisniewski
    Jan 8, 2004
  4. fred
    Replies:
    3
    Views:
    261
    Zifud
    Mar 17, 2005
  5. Replies:
    5
    Views:
    870
Loading...

Share This Page