Hello,
I'm using UltraGrid and one column has
.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
And I want to change DropDownButton symbol to ellipsis.
How can I do it?
Hi,
There's no property for this.
You could do it with a DrawFilter or a CreationFilter. But it would depend on a number of factors. By default, the dropdown button is drawn using theming. So the Windows Theming API draws the entire button and you can't change a small part, like the DropDown arrow,without drawing the whole thing yourself.
If you don't mind turning off themes for the grid or the column, then you could use a DrawFilter and just handle the BeforeDrawForeground phase to cancel the drawing of the default arrow and use GDI+ to draw a string ("..."), instead.
Thanx for quick reply, the following code works successfully:
public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { if (drawParams.Element.GetType() == typeof(EditorWithComboDropDownButtonUIElement)) { drawParams.Graphics.FillRectangle(SystemBrushes.Control, drawParams.Element.Rect); drawParams.Graphics.DrawImage(this.image, drawParams.Element.RectInsideBorders.Location); } return true; } public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element.GetType() == typeof(EditorWithComboDropDownButtonUIElement)) { return DrawPhase.BeforeDrawForeground | DrawPhase.AfterDrawForeground; } return DrawPhase.None; } private void OnLoad(object sender, EventArgs e) { this.uGMain.DrawFilter = this; }
You probably don't need to handle both phases for this. AfterDrawForeground is probably sufficient.
Yes,
AfterDrawForegroung is sufficient,
thanx