RadMultiColumnComboBox and Virtual Mode

4 posts, 1 answers
  1. Roy Gelerman
    Roy Gelerman avatar
    12 posts
    Member since:
    Jul 2006

    Posted 17 Jun 2013 Link to this post


    I am trying to use the combo in virtual mode, but am getting poor performance.  If I arrow down while focus is in the text box, it responds OK, but if I click the drop down button it takes quite a while to respond.   

    Sample code follows.  Any ideas?

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
     
            radMultiColumnComboBox1.EditorControl.EnableSorting = false;
            radMultiColumnComboBox1.EditorControl.EnableFiltering  = false;
            radMultiColumnComboBox1.EditorControl.EnableGrouping = false;
     
        }
     
     
        private void Form1_Load(object sender, EventArgs e)
        {
     
            radMultiColumnComboBox1.EditorControl.VirtualMode = true;
            radMultiColumnComboBox1.EditorControl.CellValueNeeded += new Telerik.WinControls.UI.GridViewCellValueEventHandler(EditorControl_CellValueNeeded);
            radMultiColumnComboBox1.EditorControl.ColumnCount = 2;
            radMultiColumnComboBox1.EditorControl.RowCount = 2000;
     
     
     
        }
     
        void EditorControl_CellValueNeeded(object sender, Telerik.WinControls.UI.GridViewCellValueEventArgs e)
        {
            e.Value = e.RowIndex.ToString() + "," + e.ColumnIndex.ToString();
        }
    }
  2. Answer
    Peter
    Admin
    Peter avatar
    1148 posts

    Posted 20 Jun 2013 Link to this post

    Hello Roy,

    Thank you for your question.

    This is a slow operation because 4 000 cells should be created and evaluated. However, you can slightly speed up this operation with EditorControl's LoadElementTree() method call in Form Constructor:
    public Form1()
    {
        InitializeComponent();
        radMultiColumnComboBox1.EditorControl.EnableSorting = false;
        radMultiColumnComboBox1.EditorControl.EnableFiltering = false;
        radMultiColumnComboBox1.EditorControl.EnableGrouping = false;
        radMultiColumnComboBox1.EditorControl.LoadElementTree();
    }

    I hope this optimization will be enough for you because I am not able to propose another solution for this.

    Regards,
    Peter
    Telerik
    RadChart for WinForms is obsolete. Now what?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Roy Gelerman
    Roy Gelerman avatar
    12 posts
    Member since:
    Jul 2006

    Posted 20 Jun 2013 Link to this post


    Thank You Peter

    It is a very large improvement, when LoadElementTree() is not used, CellValueNeeded is fired 4000 times immediately, but when it is used, the drop down basically only fires the event when data is needed (mostly for the cells that are currently visible, in my case 8 rows, x 2 columns, 16 calls to CellValueNeeded at a time), for me this is the desired behavior

    Thanks again
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 25 Jun 2013 Link to this post

    Hello Roy,

    I am happy that this is suitable for your scenario. 
    Should you have any other questions, do not hesitate to ask.

    Regards,
    Peter
    Telerik
    RadChart for WinForms is obsolete. Now what?
Back to Top