Isn't DataGrid.Render(writer) supposed to automatically call RenderBeginTag(writer) and RenderEndTag

Discussion in 'ASP .Net Building Controls' started by Henri, Jul 13, 2004.

  1. Henri

    Henri Guest

    Hi,

    I'm trying to customize a DataGrid adding custom rows before the endTag
    </TABLE>, and also some html before and after the control itself.
    So I wrote :

    '************************************************************
    Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

    writer.Write("html to render before base control")

    MyBase.Render(writer)

    writer.Write("html to render after base control")

    End Sub
    '************************************************************
    Public Overrides Sub RenderEndTag(ByVal writer As HtmlTextWriter)

    writer.Write("html to render before base control's closing tag")

    MyBase.RenderEndTag(writer) 'supposed to write </TABLE>

    End Sub

    But it doesn't work as RenderEndTag si never called by
    MyBase.Render(writer).
    So what's RenderEndTag() for then if it's not always called by default by
    the Render method?
    Did I miss something?
    How can I write something before DataGrid's </TABLE> then?

    Thank for your help

    Henri
     
    Henri, Jul 13, 2004
    #1
    1. Advertising

  2. Henri

    Henri Guest

    It's OK, I finally understood my mistake by myself! :)

    Henri

    "Henri" <> a écrit dans le message de
    news:...
    > Hi,
    >
    > I'm trying to customize a DataGrid adding custom rows before the endTag
    > </TABLE>, and also some html before and after the control itself.
    > So I wrote :
    >
    > '************************************************************
    > Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
    >
    > writer.Write("html to render before base control")
    >
    > MyBase.Render(writer)
    >
    > writer.Write("html to render after base control")
    >
    > End Sub
    > '************************************************************
    > Public Overrides Sub RenderEndTag(ByVal writer As HtmlTextWriter)
    >
    > writer.Write("html to render before base control's closing tag")
    >
    > MyBase.RenderEndTag(writer) 'supposed to write </TABLE>
    >
    > End Sub
    >
    > But it doesn't work as RenderEndTag si never called by
    > MyBase.Render(writer).
    > So what's RenderEndTag() for then if it's not always called by default by
    > the Render method?
    > Did I miss something?
    > How can I write something before DataGrid's </TABLE> then?
    >
    > Thank for your help
    >
    > Henri
    >
    >
    >
    >
    >
     
    Henri, Jul 13, 2004
    #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. Jan Nielsen
    Replies:
    7
    Views:
    515
    Jan Nielsen
    Feb 8, 2005
  2. Replies:
    3
    Views:
    562
    Steven Cheng[MSFT]
    Oct 9, 2006
  3. shapper

    RenderBeginTag

    shapper, Dec 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,672
    shapper
    Dec 28, 2006
  4. Lisa

    Why can't I override RenderBeginTag?

    Lisa, Sep 22, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    156
    John Saunders
    Sep 22, 2004
  5. Mark S

    Get RenderBeginTag HTML to show in Design Mode

    Mark S, Nov 16, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    120
    Mark S
    Nov 16, 2004
Loading...

Share This Page