Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default DataList Container

    Hi,

    My question is how do I set some text within my datalist itemtemplate to be
    bold, based on the higher value of two bound data items? For example, if the
    value of <%# Trim(Container.DataItem("points1") %> is greater than the
    value of <%# Trim(Container.DataItem("points2") %> then I want to make the
    value bold contained in <%# Trim(Container.DataItem("points1") %>. Any help
    is appreciated.

    Is it possible to compare the dataitem's with an IF statement within the
    datalist?

    Thanks


    Chris Fink Guest

  2. Similar Questions and Discussions

    1. CSS Clear within container only
      I have a 3 column design with the lfet and right columns floated and the center ones margins set to avoid the floats. I want to float something...
    2. Container
      Can someone explain what the Container object is, and how it it related to data binding? I can't find any reference for it anywhere. Mike
    3. Controls container
      Hi. I'm creating a .NET server component that inherit from Table (WebControls) class. It's a container that implement this html architecture...
    4. .pdf and Container field
      Can you only store a .pdf file in a container field on a Windows machine. I am on a Mac and it won't let me do that. tia --
    5. Container functions....
      In a language that I used to program in - for development we used to be able to make a function that basically just executed everything inbetween:...
  3. #2

    Default Re: DataList Container

    You can call a protected/public function and pass in the two parameters...

    <%# IsGreater(Trim(Container.DataItem("points1"),
    Trim(Container.DataItem("points2")) %>

    protected function IsGreater(ByVal pt1 as string, byVal pt2 as string) as
    string
    'convert to ints, or pass them in as ints here
    if pt1 > pt2 then
    return "<b>" & pt1 & "</b>"
    end if
    return pt1
    end function

    "Chris Fink" <chris@chrisfink.com> wrote in message
    news:uJBZOsLQDHA.3664@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > My question is how do I set some text within my datalist itemtemplate to
    be
    > bold, based on the higher value of two bound data items? For example, if
    the
    > value of <%# Trim(Container.DataItem("points1") %> is greater than the
    > value of <%# Trim(Container.DataItem("points2") %> then I want to make
    the
    > value bold contained in <%# Trim(Container.DataItem("points1") %>. Any
    help
    > is appreciated.
    >
    > Is it possible to compare the dataitem's with an IF statement within the
    > datalist?
    >
    > Thanks
    >
    >

    Karl Seguin Guest

Posting Permissions

  • You may not post new threads
  • You may 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