repeater control addat method postion.

Discussion in 'ASP .Net' started by Guoqi Zheng, Jul 26, 2004.

  1. Guoqi Zheng

    Guoqi Zheng Guest

    Sir,

    A few days ago, I asked a question about how to insert something into the
    last row of a repeater control. I got the following code from Ken,


    Private Sub Page_PreRender (ByVal sender As Object, ByVal e As
    System.EventArgs) Handles MyBase.PreRender
    Dim itm As RepeaterItem
    itm = Repeater1.Items(Repeater1.Items.Count - 1)
    Dim lblNotice As New Label
    lblNotice.Text = "Last>>>"
    itm.Controls.AddAt(0, lblNotice)
    End Sub

    It works very fine, it inserts a "Last>>>" at the begin of that row. My
    question is that is it possible to insert some string into a special postion
    on the repeater rows?

    For example, I have

    <asp:Repeater id="Datatable" runat="server">

    <ItemTemplate>
    <tr>
    <td><%#Container.DataItem("strName")%></td><td>{here I want some text
    only for last row}</td><td>soem text here</td>
    </tr>
    </ItemTemplate>
    </asp:Repeater>

    Is it possible to define the index ourselve and insert text at that special
    position?

    Thanks in advanced.

    --
    Kind regards

    Guoqi Zheng
    guoqi AT meetholland dot com
    Http://www.meetholland.com
     
    Guoqi Zheng, Jul 26, 2004
    #1
    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. =?Utf-8?B?RGV2aW4gRmVuc3RlcmhlaW0=?=

    LoadViewState not firing when Control added with AddAt

    =?Utf-8?B?RGV2aW4gRmVuc3RlcmhlaW0=?=, Jul 18, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,524
    Jyoti Ballabh
    Nov 26, 2009
  2. semesm22

    postion user control dynamically

    semesm22, Dec 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    410
    semesm22
    Dec 14, 2005
  3. =?Utf-8?B?Q2hyaXMgSG9hcmU=?=

    Controls.AddAt appears to be replacing controls

    =?Utf-8?B?Q2hyaXMgSG9hcmU=?=, Aug 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,204
    Walter Wang [MSFT]
    Aug 7, 2006
  4. cmadise
    Replies:
    0
    Views:
    551
    cmadise
    Jan 13, 2010
  5. Harry Simpson

    Design time postion of custom control??

    Harry Simpson, Jul 21, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    126
    Dawn Baker
    Jul 22, 2003
Loading...

Share This Page