Home Forums WPF controls Xceed Toolkit Plus for WPF ListBox custom filtering

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #41760 |

    Hello,

     

    We want to custom filter the ListBox. The ListBox contains many virtualized data so the Filter event is out of discussion.

    We also want to use the SearchTextBox but the value entered here could not represent the filter itself but must be combined with other data to form the filter. How could this be accomplished?

     Actually an AndFilterExpression will do the job, but using the text from the SearchTextBox.

     

    PS:Though I’m not sure the AndFilterExpression will do the job. The value from the SearchTextBox must be filtered against one property in the data object, or against another property in the same data object, depending of the value of a third property in the data object.

    Thanks,

    Bogdan

    Imported from legacy forums. Posted by bogdip (had 390 views)

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi Bogdip,

    From what I understand, You want to be able to combine a UI Filter (the SearchTextBox) and a Code-Behind Filter.

    Currently, in the ListBox template, we use a FilterControl that is bound to the SearchTextBox.

    After some tests, here’s a workaround.

    The idea would be to have the ListBox.FilterExpression be the combination of filterExpressions, so it is not modified. We can create a new ListBox with  the new property OtherFilterExpression (the Code-behind filterExpression).

    We can also create a new FilterControl, with a OtherFilterExpression property. This property would be bound to the new ListBox.OtherFilterExpression. This new FilterControl would combine its UIFilterExpression and OtherFilterExpression and store the result in its DataSourceFilterExpression (which is still bound to ListBox.FilterExpression).

    To be able to use these new ListBox and FilterContol, we have to copy the current ListBox Template and replace the FilterControl with the newly created one.

    You can find a sample in attachment. Simply reference Xceed.Wpf.Toolkit.dll and Xceed.Wpf.ListBox.dll to make it work.

    Imported from legacy forums. Posted by Fawzi [Xceed] (had 505 views)

    PallaviK
    Participant
    Post count: 1

    I have same requirement for my listbox, I couldn’t find any attachment with this post can you please add the attachment.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.