Why RadDropdownlist for Winform changes the TextAlignment to center automatically?

3 posts, 1 answers
  1. Phuong
    Phuong avatar
    2 posts
    Member since:
    Jan 2017

    Posted 10 Jan 2017 Link to this post

    Hello everyone, 

    I tried to use the RadDropdownlist in my our project based on Winform, but when i changed the SelectedIndex there is an issue happened, it changed the TextAlignment to center automatically?

    Although i tried many solutions to fix it but i cannot, so please help me to solve this issue :(

    Bellow are my code, it happened on two bold lines.

    var ddl = control as RadDropDownList;
    if (ddl != null)
    {
        if (!string.IsNullOrWhiteSpace(value))
        {
            var selectedItem = ddl.Items.FirstOrDefault(x => x.Value != null && x.Value.ToString() == value);
            if (selectedItem != null)
            {
                ddl.SelectedItem = selectedItem;
            }
        }
        else
        {
            ddl.SelectedIndex = -1;
            ddl.Text = $"Select {childField.FieldName}";
        }
    }
    else
    {
        var maskedBox = control as MarsMaskedEditBox;
        if (maskedBox != null)
        {
            maskedBox.Value = value;
        }
        else
        {
            control.Text = value;
        }
    }
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2728 posts

    Posted 10 Jan 2017 Link to this post

    Hi Phuong,

    Thank you for writing.

    This is a known issue which is logged in our Feedback Portal. The issue is now resolved and the fix will be available in the next official release. The issue details along with a workaround are available here: FIX. RadDropDownList - the TextAlignment is reset when one is setting the text of the DropDownList

    I hope this information is useful. Let me know if you need further assistance.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Phuong
    Phuong avatar
    2 posts
    Member since:
    Jan 2017

    Posted 10 Jan 2017 in reply to Dimitar Link to this post

    Hi Dimitar,

    Your information very helpful for me, it solved my code issue.

    Thanks you very much for your help :)

Back to Top