Completed
Last Updated: 18 May 2016 11:47 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 13 May 2016 05:53
Category:
Type: Bug Report
0
FIX. RadDropDownList - image alignment is changed after selecting an item when using RadDropDownStyle.DropDownList
Please refer to the attached sample project and gif file illustrating the wrong behavior.

Workaround:

private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
    this.radDropDownList1.DropDownListElement.EditableElement.TextImageRelation = TextImageRelation.TextBeforeImage;
    this.radDropDownList1.DropDownListElement.EditableElement.ImageAlignment = ContentAlignment.MiddleRight;
}

If you select the already selected item, the  image alignment is returned back to default value. You can find below how to deal with it:

 this.radDropDownList1.DropDownListElement.EditableElement.PropertyChanged += EditableElement_PropertyChanged;

private void EditableElement_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    if (e.PropertyName == "ImageAlignment" &&
        this.radDropDownList1.DropDownListElement.EditableElement.ImageAlignment != ContentAlignment.MiddleRight)
    {
        this.radDropDownList1.DropDownListElement.EditableElement.ImageAlignment = ContentAlignment.MiddleRight;
    }
    if (e.PropertyName == "TextImageRelation" &&
        this.radDropDownList1.DropDownListElement.EditableElement.TextImageRelation != TextImageRelation.TextBeforeImage)
    {
        this.radDropDownList1.DropDownListElement.EditableElement.TextImageRelation = TextImageRelation.TextBeforeImage;
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments