P
pvong
Doing this in VB.Net
I'm a newbie, but I'm learning so please be patient with me. I have a
Gridview where the last column(15) is a template column that I've got a
LinkButton in the Item field that is databound. All I want to do in the
RowDataBound is to see if the number is a positive or a negative. If it's
If DataBinder.Eval(e.Row.DataItem, "UnrealizedGains") IsNot DBNull.Value
Then
UGains = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem,
"UnrealizedGains"))
If UGains < 0 Then
e.Row.Cells(15).ForeColor = Drawing.Color.DarkRed
Else
If UGains > 0 Then
e.Row.Cells(15).ForeColor = Drawing.Color.Green
End If
End If
End If
Am I not calling the LinkButton somehow? I'm going to guess that I can not
use cells(15) for this.
Thanks!
I'm a newbie, but I'm learning so please be patient with me. I have a
Gridview where the last column(15) is a template column that I've got a
LinkButton in the Item field that is databound. All I want to do in the
RowDataBound is to see if the number is a positive or a negative. If it's
>0, then green. If it's <0, then red. What am I doing wrong?
If DataBinder.Eval(e.Row.DataItem, "UnrealizedGains") IsNot DBNull.Value
Then
UGains = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem,
"UnrealizedGains"))
If UGains < 0 Then
e.Row.Cells(15).ForeColor = Drawing.Color.DarkRed
Else
If UGains > 0 Then
e.Row.Cells(15).ForeColor = Drawing.Color.Green
End If
End If
End If
Am I not calling the LinkButton somehow? I'm going to guess that I can not
use cells(15) for this.
Thanks!