C1Combo RowTracking

Posted by: r.trofymchuk on 7 December 2020, 11:38 am EST

    • Post Options:
    • Link

    Posted 7 December 2020, 11:38 am EST

    Hi,

    I’m using C1.Win.C1List.C1Combo.

    If I place this element on a form through the form designer and set the property RowTracking=true, the program works correctly and the value in the open list is highlighted, but if I add this element on a form through the code and set the property RowTracking=true, the highlighting does not work anymore:

    private void Form1_Load(object sender, EventArgs e)

    {

    C1.Win.C1List.C1Combo cd=new C1.Win.C1List.C1Combo();

    cd.RowTracking = true;

    this.Controls.Add(cd);

    DataTable dtCombo = new System.Data.DataTable();

            dtCombo.Columns.Add("Value");
                       for (int i = 0; i < 50000; i++)
            {
                dtCombo.Rows.Add(i.ToString());
    
            }
            cd.ColumnHeaders = false;
            cd.DataSource = dtCombo;
        } 
    

    What is the difference?

  • Posted 8 December 2020, 2:33 am EST

    Hi Mike,

    As per the developers, it’s an old limitation for this control, as a workaround: use BeginInit/EndInit methods.

    C1.Win.C1List.C1Combo cd = new C1.Win.C1List.C1Combo();
    cd.BeginInit();
    this.Controls.Add(cd);
    cd.RowTracking = true;
    DataTable dtCombo = new System.Data.DataTable();
    dtCombo.Columns.Add("Value");
    for (int i = 0; i < 50000; i++)
       {
        dtCombo.Rows.Add(i.ToString());
       }
    cd.ColumnHeaders = false;
    cd.DataSource = dtCombo;
    cd.EndInit();
    

    If you need any other help, please let us know.

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels