Example of setting row and/or cell color in UltraGrid using

Posted by tbergman on 05-Jan-2017 08:05

Anyone have a simple example of the above? I found this kbase  but would appreciate a full example if possible.

Thanks,

Tom

All Replies

Posted by Mike Fechner on 05-Jan-2017 08:14

Draw filters will slow down the grid significantly…. That’s a tons of call backs form the grid into the AVM.
 
What are you trying to solve?
 
For color coding, I’d rather go with the value based formatting (UltraCalcManager).
 
For images in columns (for status fields etc.) a ValueList with images attached to a column does the job too.

Posted by jquerijero on 05-Jan-2017 09:38

DrawFilter will be an overkill for this purpose unless you are really going to create a custom row display. I think handling InitializeRow event is a much better place for changing row/cell color.

Here is a sample DrawFilter to remove focus rectangle;

USING Progress.Lang.*.
USING System.EventArgs.

CLASS common.NoRectDrawFilter IMPLEMENTS Infragistics.Win.IUIElementDrawFilter:

METHOD PUBLIC LOGICAL DrawElement( INPUT drawPhase AS Infragistics.Win.DrawPhase, INPUT-OUTPUT drawParams AS Infragistics.Win.UIElementDrawParams ):

RETURN TRUE.

END METHOD.

METHOD PUBLIC Infragistics.Win.DrawPhase GetPhasesToFilter( INPUT-OUTPUT drawParams AS Infragistics.Win.UIElementDrawParams ):

RETURN Infragistics.Win.DrawPhase:BeforeDrawFocus.

END METHOD.

END CLASS.

Posted by tbergman on 05-Jan-2017 13:44

Hi Mike,
 
I was leaning towards a draw filter as opposed to using the InitializeRow method precisely for performance problems with large data sets. It appears that initialize row fires for every record in the data source while a DrawFilter would only fire for those rows in the grid viewport.
 
I hadn’t thought about using the UltraCalcManager so thanks for this, I’ll give it a try.
 
Tom

This thread is closed