Skip to main content

Microsoft Silverlight

Answered Question Filtering with a combobox.RSS Feed

(0)

jonilda
jonilda

Member

Member

0 points

1 Posts

Filtering with a combobox.

I need help to figure out how to filter the data based on a combobox, which holds a collection of countries, and an autocomplete textbox. The textbox works fine, but I cannot make the combobox to work. I am not sure what to use in this line: <riadata:ControlParameter PropertyName="SelectedItem.Content".   Below you see the code I have now.  

<ria:DomainDataSource.FilterDescriptors >

<riadata:FilterDescriptorCollection LogicalOperator="And">

<riadata:FilterDescriptor PropertyPath="FullName"

Operator="Contains">

<riadata:ControlParameter PropertyName="Text"

RefreshEventName="SelectionChanged"

ControlName="NameFilterBox">

</riadata:ControlParameter>

</riadata:FilterDescriptor>

 

<riadata:FilterDescriptor PropertyPath="CountryID"

Operator="IsEqualTo">

<riadata:ControlParameter PropertyName="SelectedItem.Content"

RefreshEventName="SelectionChanged"

ControlName="CountryList">

</riadata:ControlParameter>

</riadata:FilterDescriptor>

 

</riadata:FilterDescriptorCollection>

</ria:DomainDataSource.FilterDescriptors>

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15884 points

1,541 Posts

Answered Question

Re: Filtering with a combobox.

Your BindingProperty is probably incorrect.

if you initialize your combobox like this 

            <ComboBox Name="cb1" SelectionChanged="ListBox_SelectionChanged">
                <ComboBoxItem Content="W"/>
                <ComboBoxItem Content="R"/>
            </ComboBox>
then, set BindingProperty to SelectedItem.Content
or else, if initialize ComboBox by binding a collection to Combobox.ItemsSource, then set BindingProperty to SelectedItem.

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities