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

RadMultiColumnComboBox and Virtual Mode

3 Answers 137 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Roy Gelerman
Top achievements
Rank 1
Roy Gelerman asked on 17 Jun 2013, 03:47 PM

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();
    }
}

3 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 20 Jun 2013, 02:12 PM
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?
0
Roy Gelerman
Top achievements
Rank 1
answered on 20 Jun 2013, 08:54 PM

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
0
Peter
Telerik team
answered on 25 Jun 2013, 12:02 PM
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?
Tags
MultiColumn ComboBox
Asked by
Roy Gelerman
Top achievements
Rank 1
Answers by
Peter
Telerik team
Roy Gelerman
Top achievements
Rank 1
Share this question
or