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

  • Thread starter Thread starter Sam
  • Start date Start date
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...
 
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...
 
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
 
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
 
Back
Top