I have a UltraGrid that is being populated with numerous lines of data. When that data does not meet certain requirements I am trying to change that line of data to red. Right now I have it changing only the active row, which is fine, but when another row becomes active to be changed the previous row changes back to the default color. Is there a way to change to individual row color and keep it changed during the entire process for print?
At the moment, I am using:
[UltraGridName}.rows(i).cells(0).band.override.ActiveRowCellApearance.rowcolor = color.red
Mike Saltzman said: Hi, The best way to apply an appearance to a row or cell based on the values in that row/cell is to use the InitializeRow event. The event passes you the row and you can examine the values of any cell in that row. Based on those values, you can set the Appearance on the row or any cell in that row.
Hi,
The best way to apply an appearance to a row or cell based on the values in that row/cell is to use the InitializeRow event.
The event passes you the row and you can examine the values of any cell in that row. Based on those values, you can set the Appearance on the row or any cell in that row.
Sorry but this doesn't work. Is there anything that interfere ? I'm in InitializeRow and I even force e.Row.Appearance.BackColor to a certain color and it's not effective. Nothing changes on the grid.
private void ugdResult_InitializeRow(object sender , InitializeRowEventArgs e){ //MR : This does not seem to work. I asked Infragistics. Waiting for an answer : http://es.infragistics.com/community/forums/p/24341/512115.aspx#512115 Color NewColor = decimal.Parse(e.Row.Cells["Psu_AMOUNT_PAID"].Value.ToString()) < 0 ? Color.Red : Color.FromArgb(0 , 0 , 0 , 0); e.Row.Appearance.BackColor = NewColor;}
I didn't have all the correct Import statements... RowRule and RuleAction depends on the Ice.Lib.ExtendedProps Import
Here is the generated code:
Private Sub CreateRowRuleOtherDtlDueDateGreaterThan_5()
' Description: Due Date Limit ' **** begin autogenerated code **** Dim errorOtherDtl_RowAction As RuleAction = RuleAction.AddRowSettings(Me.oTrans, "OtherDtl", true, SettingStyle.Error) Dim ruleActions() As RuleAction = New RuleAction() {errorOtherDtl_RowAction} ' Create RowRule and add to the EpiDataView. Dim rrCreateRowRuleOtherDtlDueDateGreaterThan_5 As RowRule = New RowRule("OtherDtl.DueDate", RuleCondition.GreaterThan, 5, ruleActions) CType(Me.oTrans.EpiDataViews("OtherDtl"),EpiDataView).AddRowRule(rrCreateRowRuleOtherDtlDueDateGreaterThan_5) ' **** end autogenerated code **** End Sub
Thanks,Bud
I, too, am using Epicor (version 10.0.700.x) and I tried to add a row rule that would highlight rows where the due date is more than 5 days out.
I followed the steps outlined in the Epicor customization guide several times and always get this error message when I compile it:
Compiling Custom Code ...
----------errors------------
Error: BC30002 - line 573 (1372) - Type 'RuleAction' is not defined. Error: BC30002 - line 574 (1373) - Type 'RuleAction' is not defined. Error: BC30002 - line 576 (1375) - Type 'RowRule' is not defined.
** Compile Failed. **
What could I be doing wrong?
Thanks,Bud Manz
Hi Mike,
Thanks for your answer, I have found a solution to this case.
This code on the project within Epicor, it is one rule in EpicorThank you.