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
160
Sort by FilterCondition?
posted

Is this possible? I have 3 columns in a combo drop down: Part # (KeyCol1), UPC (KeyCol2), and Description (KeyCol3). When a user types in the combobox, I want the combobox to be able to filter Part #s that start with the combobox text, UPCs that match that text and find Descriptions that are like the text. Then I want the list to sort by Part #s that most closely match the typed text. This is what I have so far:

 UltraComboControl.DisplayLayout.Bands(0).ColumnFilters(KeyCol1)

.FilterConditions.Add(FilterComparisionOperator.StartsWith,UltraComboControl.Text)

UltraComboControl.DisplayLayout.Bands(0).ColumnFilters(KeyCol2)

.FilterConditions.Add(FilterComparisionOperator.Equals, UltraComboControl.Text)

 UltraComboControl.DisplayLayout.Bands(0).ColumnFilters(KeyCol3)

.FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Like, "*" & UltraComboControl.Text & "*")

This returns everything that matches the criteria, I'm just not sure if I can sort it by what it most matches.

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    I'm not sure I understand exactly what you want to do here or how you want to sort. But I don't think I need to. You have total control over the sorting. What you do is use a SortComparer on the column being sorted.

    Again... I'm not entirely sure what you want to sort by here. So that might not work if your sorting relies on the filtering to be performed first. Filtering is done asynchronously by default and in this case, my guess is that you want to know the number of rows before you can sort. So, if that is the case, you would have to handle the BeforeRowFilterChanged event and set the ProcessMode to synchronous.


            private void ultraCombo1_BeforeRowFilterChanged(object sender, BeforeRowFilterChangedEventArgs e)
            {
                e.ProcessMode = ProcessMode.Synchronous;
            }

Children
No Data