Style changes based upon Data Values

G

Guest

I want to change the style of a data presented based upon the value of the
data. For example, I if the value is positive I want it to appear black but
if it is negative I want it to be red. Any suggestions would be helpful!
 
Y

Yunus Emre ALPÖZEN [MCSD.NET]

Just bind style or property you want.. I do not know your code but adding a
binding like this should do what u want.

((Decimal)DataBinder.Eval(Container.DataItem,"Price"))>0 ? "positiveStyle" :
"negativeStyle"

--
HTH

Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top