With an UltraCombo, I noticed that when the control is smaller than the dropped-down section, the dropped-down section and the control are left-aligned and the dropped-down section expands to the right. However, when the control is larger than the dropped-down section, the latter is right aligned. How can I align both sections on their left edge in all cases? The picture below displays the issue and expected result.
Thanks, Marcel
Hello Marcel,
The UltraCombo does not support that functionality yet.
If you are only showing only one column of information then maybe the UltraComboEditor will suffice in this scenario (it has a DropDownListAlignment property that will do what you want.)
But you can also use the AutoFitStyle of the UltraCombo in order to make the drop-down section to fill all the space. Look the following code snippet how to achieve that:
ultraCombo1.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;
I think also that your question is good and you can also open FR for that functionality from here:
https://ko.infragistics.com/Login.aspx?returnURL=%2fDevCenterLogin.aspx%3freturnURL%3d%2fProtected%2fRequestFeature.aspx
Sincerely,Danko ValkovDeveloper Support EngineerInfragistics, Inc.
You may also want to take a look at the DropDownWidth property on the control. There are certainy special values, like -1, that can be used to size the dropdown to the control.
Here are my findings:
/// <summary>
/// This creation filter makes sure the left edges of the text and drop down sections
/// of the UltraCombo are aligned.
/// Without this, when the drop-down is narrower than the text portion
/// both sections have their right-edge aligned instead.
/// </summary>
private class GlueDropDownToLeftCreationFilter : IUIElementCreationFilter
{
#region Implementation of IUIElementCreationFilter
bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent)
return false; // let the child elements be created normally
}
void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent)
if (parent is UltraGridUIElement)
UltraGridUIElement gridUIElement = (UltraGridUIElement)parent;
Control textSection = gridUIElement.Grid;
Control dropDownSection = gridUIElement.Control.Parent;
// this method is called more than once, the first time the drop-down section
// is not attached to the UIElements which explains this "if".
if (dropDownSection != null)
// get wanted location (just below text portion) in the
// textSection's parent's referential and convert to screen referential
Point location = new Point(textSection.Left, textSection.Bottom);
location = textSection.Parent.PointToScreen(location);
// when control has parent we need to convert the location back to this parent's referential
if (dropDownSection.Parent != null)
location = dropDownSection.Parent.PointToClient(location);
//we're good now
dropDownSection.Location = location;
#endregion
I am facing the same issue - Has there been any updates to the functionality to do this any differently since 2009? Thank you
There have been no changes to this functionality that I know of - unless some part of this was a bug that was fixed, and I don't think that is the case.
Mike,
Thanks for the update
Regards
Stephen