filter combobox on the RadGridView

2 posts, 0 answers
  1. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 30 Jun 2011 Link to this post

    Hi Telerik,

    I couldn't filter between the two combobox on the RadGridView.
    I want to;
    when is selected item in first combobox,
    second combobox must be filter, according to the first combobox selected item.

    This filter must be run insert and update mode.

    How can I do?

     

    Thanks,
    Mehmet

     

     

    <UserControl.Resources>
        <riaControls:DomainDataSource x:Name="GuestAccountData" AutoLoad="True" QueryName="GetGuestAccount" x:Key="GuestAccountKey">
          <riaControls:DomainDataSource.DomainContext>
            <domain:HotelDomainContext />
          </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <riaControls:DomainDataSource x:Name="PosPointTypeData" AutoLoad="True" QueryName="GetPosPointType" x:Key="PosPointTypeKey" >
          <riaControls:DomainDataSource.DomainContext>
            <domain:HotelDomainContext />
          </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <!--<riaControls:DomainDataSource x:Name="PosPointProductTypeData" AutoLoad="True" QueryName="GetPosPointProductType" x:Key="PosPointProductTypeKey">
          <riaControls:DomainDataSource.DomainContext>
            <domain:HotelDomainContext />
          </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>-->
        <riaControls:DomainDataSource x:Name="PosPointProductTypeData" AutoLoad="True" QueryName="GetPosPointProductType" x:Key="PosPointProductTypeKey" LoadSize="50" LoadDelay="0" FilterOperator="Or">
          <riaControls:DomainDataSource.DomainContext>
            <domain:HotelDomainContext />
          </riaControls:DomainDataSource.DomainContext>
          <riaControls:DomainDataSource.FilterDescriptors>
            <!--<riaControls:FilterDescriptor PropertyPath="PosTypeName" Operator="IsEqualTo"  IgnoredValue = "NULL" Value="{Binding ElementName=AccountGridView, Path=SelectedItem.AccountPosPoint, FallbackValue=0 }" />-->
            <!--<riaControls:FilterDescriptor PropertyPath="PosTypeName" Operator="IsEqualTo" IgnoredValue = "NULL" Value="{Binding e.NewData, ElementName=AccountGridView, FallbackValue=0}" />-->
          </riaControls:DomainDataSource.FilterDescriptors>
        </riaControls:DomainDataSource>
      </UserControl.Resources>

    ------------------------------------------------------------------------------------------
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
          <RowDefinition Height="26"/>
          <RowDefinition Height="500*"/>
        </Grid.RowDefinitions>
        <telerik:RadButton x:Name="SaveBtn"  Grid.Row="0" HorizontalAlignment="Left" Height="26" Width="100"  Content="Save" Click="Account_Save" />
        <telerik:RadGridView x:Name="AccountGridView"  Grid.Row="1" ShowInsertRow="True" AutoGenerateColumns="False" ItemsSource="{Binding Data,ElementName=GuestAccountData}">
          <telerik:RadGridView.Columns>
            <telerik:GridViewComboBoxColumn x:Name="PosPointTypeName" Header="Pos Point" HeaderTextAlignment="Center" ItemsSource="{Binding Data, Source={StaticResource PosPointTypeKey},Mode=TwoWay}"
                                                DataMemberBinding="{Binding AccountPosPoint, Mode=TwoWay}" DisplayMemberPath="PosPointTypeName" SelectedValueMemberPath="PosPointTypeName" Width="120" >
              <telerik:GridViewComboBoxColumn.CellTemplate>
                <DataTemplate>
                  <TextBlock Text="{Binding AccountPosPoint, Mode=TwoWay}"/>
                </DataTemplate>
              </telerik:GridViewComboBoxColumn.CellTemplate>
            </telerik:GridViewComboBoxColumn>
            <telerik:GridViewComboBoxColumn x:Name="PosPointProductTypeName" Header="Product"  HeaderTextAlignment="Center" ItemsSource="{Binding Data, Source={StaticResource PosPointProductTypeKey}}" 
                                                DataMemberBinding="{Binding AccountPosPointProduct, Mode=TwoWay}" DisplayMemberPath="ProductTypeName" SelectedValueMemberPath="ProductTypeName" Width="120"/>
          </telerik:RadGridView.Columns>
        </telerik:RadGridView>
      </Grid>

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 01 Jul 2011 Link to this post

    Hi Mehmet,

    Please, refer to this blogpost. It illustrates how an approach that is valid in similar scenarios.

    Best wishes,
    Ivan Ivanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top