Display of the selected element

4 posts, 1 answers
  1. QuizzBox
    QuizzBox avatar
    46 posts
    Member since:
    Jan 2011

    Posted 29 Aug 2011 Link to this post

    hi, i have a multicolumncombox object on my form, i only display the first column.
    The cell width is larger than the multicolumncombox, so when i select an item, it's right aligned in the multicolumncombobox object like the screenshot.

    Optionnaly i don't want the control to be highlighted when i change selected item.


    thanks
  2. QuizzBox
    QuizzBox avatar
    46 posts
    Member since:
    Jan 2011

    Posted 31 Aug 2011 Link to this post

    up!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 01 Sep 2011 Link to this post

    Hi Nermond,

    Thank you for writing.

    This issue was already reported by another user of ours. Please follow this link, where you can add your vote for this issue, and also subscribe for its status updates.

    Meanwhile, you can work around this issue, by using the following code snippet. The code in the form Shown event is to fix the text alignment when the form is loaded, and the code in the SelectedIndexChanged fixes the text after selection change:
    void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string oldText = radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.Text;
        radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.Text = string.Empty;
        radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.Text = oldText;
    }
     
    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);
        string oldText = radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.Text;
        radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.Text = string.Empty;
        radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.Text = oldText;
    }

    I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
     
    Kind regards,
    Stefan
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  5. QuizzBox
    QuizzBox avatar
    46 posts
    Member since:
    Jan 2011

    Posted 02 Sep 2011 Link to this post

    super, that works very well :-)
Back to Top