Skip to content

Replies

0
Torrey
Torrey answered on Nov 19, 2008 3:49 PM

Class Level Variables: 

Dim condition1 As New OperatorCondition(ConditionOperator.LessThan, 0)
Dim appearance1 as Infragistics.Win.Appearance = New Infragistics.Win.Appearance()
Dim valAppearance1 As New ConditionValueAppearance()

From Form_Load:

appearance1.ForeColor = Color.Red
valAppearance1.Add(condition1, appearance1)

Then in your InitializeLayout:

For ii As Integer = 1 To .Columns.Count – 1     Dim col As UltraGridColumn = .Columns(ii)
     col.ValueBasedAppearance = valAppearance1
     col.Format = "###0.0000;(###0.0000);0.0000"
Next ii

0
Torrey
Torrey answered on Nov 19, 2008 1:28 PM

I used my junk yard project to toss this video together, so sorry for the sloppiness of it, but you'll see how the conditions work to turn the value foreground to red without using any InitializeRow.

0
Torrey
Torrey answered on Nov 19, 2008 12:45 AM

View your UltraGrid Designer and navigate your ways to edit the properties of the columns. Select the column that you'll be formatting the negative numbers. Click into the Format property and paste this into there:

$#,##0.00;($#,##0.00);Zero

You can find the formatting references from Microsoft by clicking this link. For the conditional formatting you do not need to use InitializeRow, as we are already in the properties for this column, scroll down to the property called ValueBasedAppearance. With this dialog you can set conditions to change the appearance of the cell based on the value. Don't forget to delete what you had in InitializeRow to save overhead and any conflicting.

Hope this helps you out!

0
Torrey
Torrey answered on Oct 29, 2008 2:34 PM

Maybe I'm totally crazy because I don't believe my eyes on these replies from Infrigistics employees. Isn't the WebListbar similar to what you're looking for in the ASP.NET controls?