Infragistics UltraWinGrid - have negative value in a column show up red

S

Sam

Does anyone know how to make it so that in my "Balance" column that
when if the value is negative to display red and if positive display
black(default).

I've got a multi-banded grid, and some rows on this band will be
positive and some will be negative.

I can't seem to figure out how to do it.

Thanks...
 
L

lou

You may want to post your question on Infragistics' newsgroup:
new.infragistics.com - Infragistics.dotnet.UltraWinGrid

--
Melissa Whalen, Programmer/Analyst
AIT, BBA/IS


| Does anyone know how to make it so that in my "Balance" column that
| when if the value is negative to display red and if positive display
| black(default).
|
| I've got a multi-banded grid, and some rows on this band will be
| positive and some will be negative.
|
| I can't seem to figure out how to do it.
|
| Thanks...
 
R

Ron Allen

Melissa,
Let me correct that. They are currently using
infragistics.dotnet.wingrid. The infragistics.dotnet.ultrawingrid newsgroup
isn't taking new messages as of a few weeks ago.
A short answer would be to use InitializeRow to color the text in that
cell and also use AfterCellUpdate to check for changes in the value to color
appropiately.

Ron Allen
 
S

Sam

Thanks.

For anyone who'd like the code:

Private Sub grdMyGrid_InitializeRow(ByVal sender As Object, _
ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) _
Handles grdMyGrid.InitializeRow

If (e.Row.Band.Index = 2) Then
With e.Row.Cells("Balance")
If (CType(.Value, Double) < 0) Then
.Appearance.ForeColor = Color.Red
Else
.Appearance.ForeColor = New Color
End If
End With
End If
End Sub
 

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

Top