DataList Container

C

Chris Fink

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
 
K

Karl Seguin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,077
Messages
2,570,569
Members
47,206
Latest member
MalorieSte

Latest Threads

Top