The UltraComboEditor of Infragistics has an AutoComplete feature that displays suggestions in a popup as the user types.
The part typed by the user appears bold.
To comply with our graphic chart, we need the suggestions to be colored instead of bold.
In general, I would like to control the way suggestions are displayed.
How can I achieve this ?
Hi,
There is currently no way to change this behavior. You should Submit a feature request to Infragistics
Hello,
I just did this. I think a set of AutoComplete*something*Appearance would help.
Thank you !
This can be accomplished using a draw filter:
public class SuggestTextDrawFilter : IUIElementDrawFilter { public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { if (drawParams.Font.Bold) { drawParams.AppearanceData.FontData.Bold = DefaultableBoolean.False; drawParams.AppearanceData.ForeColor = Color.Blue; } return false; } public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element is TextSectionUIElement && drawParams.Element.Parent is FormattedTextUIElement) return DrawPhase.BeforeDrawElement; return DrawPhase.None; } }
To use the draw filter simply set the draw filter on your editor:
this.ultraComboEditor1.DrawFilter = new SuggestTextDrawFilter();
Let me know if you have any questions with this matter.
I assumed you were referring to UltraGrid. UltraComboEditor doesn't have any filtering functionality. I guess you are referring to the AutoCompleteMode. If that's the case, then there is no way to do that with either UltraComboEditor or UltraCombo.
Hi Mike
Looks like an easy way however I couldn't find the FilterRow event on UltraComboEditor. Are you talking about UltraCombo? Can you give me an example?
The easiest way to do this would be to handle the FilterRow event of the grid. You can examine the row and the filters and then decide whether or not to filter out the row yourself, rather than letting the grid's build-in filtering do it.
Hi Alan,
Is there a way to change the filter mode as well? like typing two or more words seperated with space will return a narrower result set? Consider I am looking for "LOGON FAILURES" and typing "LOGON" or "FAILURE" will give me more than 100 items. Let's say I typed "LO <space> FA". Currently it will return 0 items. Can I implement something to change this behaviour? (split the text and return the interception of seperate result sets)