Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to apply view-side filtering in MVVM?
    primarykey
    data
    text
    <p>I'm using Telerik RadGridView in my project (which essentially is a standart GridView). This component has its own filtering functionality and I want to get advantage of it.</p> <p>Filtering itself I am planning to do based on several combobox selected values. So if I got right idea of MVVM, I need to bind the combos to some ViewModel's properties. But here's a problem of how to pass these selected values back to View's component? how to make it refresh filtering as selected value change?</p> <p>upd: I use SimpleMVVM framework.</p> <p>XAML of MainWindow:</p> <pre><code>&lt;Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...... DataContext="{Binding Source={StaticResource Locator}, Path=MainPageViewModel}"&gt; &lt;StackPanel Height="auto"&gt; &lt;telerik:RadMenu VerticalAlignment="Top"&gt; ...... &lt;/telerik:RadMenu&gt; &lt;my:Expander VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="auto" Width="auto"/&gt; &lt;my:CustomerView Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="auto" Width="auto"/&gt; &lt;/StackPanel&gt; </code></pre> <p></p> <p>XAML of expander:</p> <pre><code>&lt;UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...... &gt; &lt;Grid Margin="10,10,0,10" Width="684" Height="97" VerticalAlignment="Top" HorizontalAlignment="Left" &gt; &lt;telerik:RadExpander x:Name="radExpander" IsExpanded="True" HorizontalAlignment="Stretch" VerticalAlignment="Top" telerik:AnimationManager.IsAnimationEnabled="True" Margin="0,0,0,0" Grid.RowSpan="2"&gt; &lt;telerik:RadComboBox HorizontalAlignment="Left" Margin="244,-2,0,0" VerticalAlignment="Top" Width="154" Height="26" ItemsSource="{Binding Path=AllLevels}" DisplayMemberPath="name" SelectedItem="{Binding SelectedEventLevel}"/&gt; ....... &lt;/Grid&gt; &lt;/telerik:RadExpander&gt; &lt;/Grid&gt; </code></pre> <p></p> <p>XAML of CustomerView:</p> <pre><code> &lt;telerik1:RadGridView Name="EventList" .... ItemsSource="{Binding SportEventsList}" AutoGenerateColumns="False"&gt; &lt;telerik1:RadGridView.Columns&gt; ..... &lt;/telerik1:RadGridView.Columns&gt; &lt;/telerik1:RadGridView&gt; </code></pre> <p>Snippet of Viewmodel's code:</p> <pre><code> private ObservableCollection&lt;sportevent&gt; _sportEventsList; public ObservableCollection&lt;sportevent&gt; SportEventsList { get { return _sportEventsList; } set { _sportEventsList = value; NotifyPropertyChanged(vm =&gt; vm.SportEventsList); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload