RadMultiColumnCombobox automatically select the first item

4 posts, 0 answers
  1. Pham
    Pham avatar
    7 posts
    Member since:
    Aug 2012

    Posted 09 Apr 2012 Link to this post

    Hello!
    I have a problem with RadMultiColumnCombobox.
    I'm using Telerik Control Q2 2011 and VS 2010.
    I have a form like the below code:

                Form f1 = new Form();
                RadDock rd1 = new RadDock();
                rd1.Dock = DockStyle.Fill;
                DocumentWindow dw1 = new DocumentWindow();
                rd1.AddDocument(dw1);
                DocumentWindow dw2 = new DocumentWindow();
                rd1.AddDocument(dw2);
                RadMultiColumnComboBox cbx1 = new RadMultiColumnComboBox();
                dw1.Controls.Add(cbx1);
                cbx1.DataSource = GetAllCountries(); (I get list items in the database)
                f1.Controls.Add(rd1);
                f1.Show();

    When I select one item in cbx1 and do a drag-drop action in dw1, cbx1 will always automatically select the first item.
    If anyone has a suggestion, please let me know.

    Thanks!

  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 11 Apr 2012 Link to this post

    Hello Pham,

    Thank you for writing.

    I am not able to assist you efficiently with the supplied information. Could you share with us your drag and drop scenario? How do you implement and design the drag and drop action?

    I am looking forward to your reply.

    Kind regards,
    Svett
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Pham
    Pham avatar
    7 posts
    Member since:
    Aug 2012

    Posted 11 Apr 2012 Link to this post

    Hello Svett,
    thank for your reply!

    I use the default drag and drop action in the RadDock control. I just use mouse to hold dw1 and drop it in another tapStrip.
    I attach three images with this reply, hope they are useful to you.
    PS: i only get this problem in the first drag and drop action after open form.

    Thanks!
  5. Svett
    Admin
    Svett avatar
    728 posts

    Posted 17 Apr 2012 Link to this post

    Hi Pham,

    Thank you for the additional details.

    I managed to reproduce the issue. It is caused by the fact that the BindingContext of the RadMultiColumnComboBox is changed. I added the issue to our public issue tracking system. It will be addressed in one of next releases. Here is a link to it: http://www.telerik.com/support/pits.aspx#/public/winforms/10734

    Meanwhile, you can use the following code snippet as temporary solution:

    private int? selectedIndex;

    DragDropService service = this.radDock1.GetService<DragDropService>();
    service.Starting += new StateServiceStartingEventHandler(service_Starting);
    service.Stopped += new EventHandler(service_Stopped);

    private void service_Stopped(object sender, EventArgs e)
    {
        if (selectedIndex != null)
        {
            this.radMultiColumnComboBox1.SelectedIndex = selectedIndex.Value;
            selectedIndex = null;
        }
    }
     
    private void service_Starting(object sender, StateServiceStartingEventArgs e)
    {
        DocumentWindow documentWindow = e.Context as DocumentWindow;
     
        if (documentWindow != null && documentWindow.Controls.Contains(this.radMultiColumnComboBox1))
        {
            selectedIndex = this.radMultiColumnComboBox1.SelectedIndex;
        }
    }

    I have updated your Telerik points for this report.

    Regards,
    Svett
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top