Other ways to set datasource

2 posts, 0 answers
  1. Jo
    Jo avatar
    4 posts
    Member since:
    Apr 2014

    Posted 06 Jan 2015 Link to this post

    I set the datasource of multicolumncombobox everytime dropdown opening event is fired.
    But on the first instance, it only show the header and a vertical scroll like 1st.png attachment. It did have rows since if I press downbutton, a row will be selected
    while on the second instance and later, it works like 2nd.png attachment.

    private void combobox_DropDownOpening(object sender, System.ComponentModel.CancelEventArgs args)
                combobox.DataSource = datatable;

    Any suggestions?
  2. Dimitar
    Dimitar avatar
    2983 posts

    Posted 09 Jan 2015 Link to this post

    Hi Joem,

    Thank you for writing.

    This is not a valid scenario and you should not set the DataSource in this event. The data source should be set before this event is fired so the drop down size can be correctly measured. Since you need to change the data source in such way I will recommend you to use the GotFocus event: 
    void radMultiColumnComboBox1_DropDownOpening(object sender, CancelEventArgs args)
        radMultiColumnComboBox1.DataSource = null;
        radMultiColumnComboBox1.DataSource = GetTable();
        radMultiColumnComboBox1.DisplayMember = "Name";

    I hope this helps.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top