This is a migrated thread and some comments may be shown as answers.

RadMultiColumnCombobox automatically select the first item

3 Answers 241 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pham
Top achievements
Rank 1
Pham asked on 09 Apr 2012, 09:10 AM
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!

3 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 11 Apr 2012, 04:49 PM
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 >>
0
Pham
Top achievements
Rank 1
answered on 12 Apr 2012, 03:42 AM
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!
0
Svett
Telerik team
answered on 17 Apr 2012, 09:31 AM
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 >>
Tags
General Discussions
Asked by
Pham
Top achievements
Rank 1
Answers by
Svett
Telerik team
Pham
Top achievements
Rank 1
Share this question
or