This is a migrated thread and some comments may be shown as answers.

filter combobox on the RadGridView

1 Answer 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mehmet
Top achievements
Rank 1
Mehmet asked on 30 Jun 2011, 02:24 PM

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>

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 01 Jul 2011, 10:15 AM
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
Tags
GridView
Asked by
Mehmet
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or