Nested Repeater question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bojesphob

    #1

    Nested Repeater question

    Can someone help? I
    have a nested repeater in which I wish to format one of
    the bits of data in currency. I know that the code for the
    regular repeater (which works fine in parent) is
    databinder.eval (Container.Data Item, "Net", "{0:c}") . BUT
    I use that code in the nested repeater and IT DOES NOT
    WORK!!!! In that code I have DataBinder.Eval
    (Container.Data Item, "Reduction" , "{0:c}") and the page
    gives me the error "Error: System.Web.Http Exception:
    DataBinder.Eval : 'System.Data.Da taRow' does not contain a
    property with the name Reduction."
    If I only use Container.DataI tem("Reduction" ) it works
    fine! I was told over on asp.net that the code I tried to
    use it what I should use, and that it works fine for them,
    but I cannot get it to work! I spelled everything
    correctly, and as far as I know bound everything
    correctly, but it still will not work! Does anyone have a
    working example of a nested repeater with a formatted
    column? I really need to get this fixed, I have other
    projects which need to get done, but this takes priority,
    Help!
  • David Wier

    #2
    Re: Nested Repeater question

    Try this - - create a Function:
    Function doFormat(sItem as Decimal) ' Here, you can use whatever datatype
    you have assigned to the field
    Dim s as String
    s=String.Format ("{0:c}", sItem)
    doFormat=s
    end function

    Then, in your nested DataList - -
    <%# doFormat(Contai ner.DataItem("R eduction"))

    David Wier





    "Bojesphob" <jschmidt@pca-star.com> wrote in message
    news:0bb601c358 2d$fa40cff0$a30 1280a@phx.gbl.. .[color=blue]
    > Can someone help? I
    > have a nested repeater in which I wish to format one of
    > the bits of data in currency. I know that the code for the
    > regular repeater (which works fine in parent) is
    > databinder.eval (Container.Data Item, "Net", "{0:c}") . BUT
    > I use that code in the nested repeater and IT DOES NOT
    > WORK!!!! In that code I have DataBinder.Eval
    > (Container.Data Item, "Reduction" , "{0:c}") and the page
    > gives me the error "Error: System.Web.Http Exception:
    > DataBinder.Eval : 'System.Data.Da taRow' does not contain a
    > property with the name Reduction."
    > If I only use Container.DataI tem("Reduction" ) it works
    > fine! I was told over on asp.net that the code I tried to
    > use it what I should use, and that it works fine for them,
    > but I cannot get it to work! I spelled everything
    > correctly, and as far as I know bound everything
    > correctly, but it still will not work! Does anyone have a
    > working example of a nested repeater with a formatted
    > column? I really need to get this fixed, I have other
    > projects which need to get done, but this takes priority,
    > Help![/color]



    Comment

    Working...