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

Urgent- Multicombobox help

1 Answer 38 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Truong
Top achievements
Rank 1
Truong asked on 10 Jul 2012, 06:52 AM
Hi everyone! Need helps

I have problem when I am working on multicombobox of teleirk.
That problem is: I create a linq query "linqquery" and then multicombobox.datasource= linqquery

i used selected change event. but i did not work when i select first record in the first time.
att: I selected second record and select first record again -> it worked. I didn't know why?

Thank you

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Jul 2012, 01:42 PM
Hello Truong,

Thank you for writing.

I am not sure exactly which event are you referring to, however, a possible reason for the observed behavior is if you are subscribing to the event after you set the DataSource. In order to get the initial change in the selection you need to subscribe prior setting the DataSource:
public Form1()
{
    InitializeComponent();
 
    Random r = new Random();
    DataTable table = new DataTable();
    table.Columns.Add("ID", typeof(int));
    table.Columns.Add("Name", typeof(string));
    table.Columns.Add("Bool", typeof(bool));
    table.Columns.Add("DateColumn", typeof(DateTime));
 
    for (int i = 0; i < 10; i++)
    {
        table.Rows.Add(i, "Row " + i, r.Next(10) > 5 ? true : false, DateTime.Now.AddHours(i));
    }
 
 
    radMultiColumnComboBox1.SelectedIndexChanged += new EventHandler(radMultiColumnComboBox1_SelectedIndexChanged);
    this.radMultiColumnComboBox1.DataSource = table;
 
}
 
void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    //your logic here
}

If you continue experiencing this behavior, please provide me with details how can I reproduce it on my end, so I can investigate it and help you with it.

Greetings,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Truong
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or