Professional Web Applications Themes

Nested Repeater question - ASP.NET General

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.DataItem, "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.DataItem, "Reduction", "{0:c}") and the page gives me the error "Error: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRow' does not contain a property with the name Reduction." If I only use Container.DataItem("Reduction") it works fine! I was told over on asp.net that the ...

  1. #1

    Default 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.DataItem, "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.DataItem, "Reduction", "{0:c}") and the page
    gives me the error "Error: System.Web.HttpException:
    DataBinder.Eval: 'System.Data.DataRow' does not contain a
    property with the name Reduction."
    If I only use Container.DataItem("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!
    Bojesphob Guest

  2. #2

    Default 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(Container.DataItem("Reduction"))

    David Wier
    [url]http://aspnet101.com[/url]
    [url]http://aspexpress.com[/url]



    "Bojesphob" <jschmidtpca-star.com> wrote in message
    news:0bb601c3582d$fa40cff0$a301280aphx.gbl...
    > 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.DataItem, "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.DataItem, "Reduction", "{0:c}") and the page
    > gives me the error "Error: System.Web.HttpException:
    > DataBinder.Eval: 'System.Data.DataRow' does not contain a
    > property with the name Reduction."
    > If I only use Container.DataItem("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 Guest

Similar Threads

  1. linkbutton in nested repeater doesnt fire
    By Nicolas Chevet in forum ASP.NET Data Grid Control
    Replies: 5
    Last Post: February 16th, 07:16 AM
  2. Nested repeater databinding question
    By Ed Allan in forum ASP.NET General
    Replies: 0
    Last Post: August 1st, 01:10 PM
  3. Error with Nested Repeater
    By Ray at in forum ASP
    Replies: 2
    Last Post: July 30th, 05:06 PM
  4. Nested Repeater - 3 levels - datasource
    By Ed Allan in forum ASP.NET General
    Replies: 1
    Last Post: July 30th, 09:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139