Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Show top 10 result for suggestion in ultracombo
posted

Hi Guy,

I have a large datasource with more than 10.000 row for autocomplete using in UltraCombo, the performance is very poor.

Could we customize the searching for autocomplete to show only top 20 result in datasource?

Thanks

Parents
No Data
Reply
  • 1560
    Offline posted

    Hello,

    I have been looking into your question. I can suggest taking a look at the WinGrid Performance Guide.  UltraCombo is derived from the same base class as UltraGrid, so many of the same performance issues apply.

    I tried to reproduce the described behavior and generate a DataTable with 10 000 rows as DataSource of UltraCombo, however, I didn't notice any performance issue. Could you please provide more details regarding your issue?  Do you have performance issues when you try to load your 100 000 items in the combo, or when you try to dropdown the list with items for the first time or maybe you have performance issues when you are using AutoCompleteMode?

    Additionally, in order to show only the top 20 filtered rows, my suggestion is to handle the TextChanged event and after that, to restore them you can handle the AfterCloseUp event.

     

      private void ultraCombo1_TextChanged(object sender, EventArgs e)
            {
                //get filtered rows
                var rows = (sender as UltraCombo).Rows.GetFilteredInNonGroupByRows();
     
                for (int i = 0; i < rows.Length; i++)
                {
                    if((sender as UltraCombo).Text == "") //if the text box is empty remove all filters and show all rows
                    {                    
                        rows[i].Hidden = false;
                    }
                    else
                    {
                        if (i < 20)
                        {
                            rows[i].Hidden = false;
                        }
                        else
                        {
                            rows[i].Hidden = true;
                        }
                    }              
     
                }
     
            }
            //restore all rows in order to be able to select different value
            private void ultraCombo1_AfterCloseUp(object sender, EventArgs e)
            {
                var rows = (sender as UltraCombo).Rows;
                foreach (var _row in rows)
                {
                    _row.Hidden = false;
                }
            }

    If this is not an accurate demonstration of what you are trying to achieve please feel free to provide your own sample. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach it in this case.

    Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.

    Thank you for your cooperation.

    Sincerely,

    Teodosia Hristodorova

    Associate Software Developer

Children