check for specific repeater value - can it be done?

Discussion in 'ASP .Net' started by Bob H, Mar 3, 2004.

  1. Bob H

    Bob H Guest

    Hi,

    I've a data repeater on a form that gets populated from an SP. In the
    repeater, I've a ItemTemplate row that outputs the field...

    <td colspan="1">
    <%# DataBinder.Eval(Container.DataItem, "FieldValue")%>
    </td>

    ....Is there anyway to check the values in this Repeater field as it gets
    populated so that I can replace it with another value?? Can it be done and
    if so....any pointers please?

    Many thanks.

    Best regards

    Bob
     
    Bob H, Mar 3, 2004
    #1
    1. Advertising

  2. See the ItemCreated event for the Repeater class (it will be easier if you
    include the value in a control such as label).

    Another option would be to change the value in your SQL query (I would
    rather use the event when I want to highlight particular values).

    Basically (untested) :

    Sub Repeater1_ItemCreated(sender As Object, e As RepeaterItemEventArgs)
    Dim Label as Label
    Select Case e.Item.Type
    Case ListItemType.Item,ListItemType.AlternatingItem
    Label=e.Item.FindControl("MyLabel")
    If Label.Text="Warning" Then
    Lable.Text="WARNING"
    Label.Font.Bold=True
    End If
    End Select
    End Sub


    --

    "Bob H" <> a écrit dans le message de
    news:c2536t$9gp$...
    > Hi,
    >
    > I've a data repeater on a form that gets populated from an SP. In the
    > repeater, I've a ItemTemplate row that outputs the field...
    >
    > <td colspan="1">
    > <%# DataBinder.Eval(Container.DataItem, "FieldValue")%>
    > </td>
    >
    > ...Is there anyway to check the values in this Repeater field as it gets
    > populated so that I can replace it with another value?? Can it be done and
    > if so....any pointers please?
    >
    > Many thanks.
    >
    > Best regards
    >
    > Bob
    >
    >
     
    Patrice Scribe, Mar 3, 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. kris
    Replies:
    0
    Views:
    525
  2. kris
    Replies:
    0
    Views:
    489
  3. kris
    Replies:
    1
    Views:
    5,254
  4. praba kar
    Replies:
    1
    Views:
    418
    Michael Hoffman
    Apr 9, 2005
  5. Zhidian Du
    Replies:
    0
    Views:
    167
    Zhidian Du
    Feb 21, 2004
Loading...

Share This Page