Filtering DataFormComboBoxField

4 posts, 0 answers
  1. Harald
    Harald avatar
    48 posts
    Member since:
    Oct 2013

    Posted 17 Sep 2015 Link to this post

    I am using a DataSource and a DataForm with a DataTemplate in WPF. In principle it works.
    DataSource:
    <telerik:RadEntityFrameworkDataSource Name="AcademicTitleDataSource" QueryName="CatalogEntries">
      <telerik:RadEntityFrameworkDataSource.DbContext>
        <local:MyEntities x:Name="AcademicTitleContext" />
      </telerik:RadEntityFrameworkDataSource.DbContext>
    </telerik:RadEntityFrameworkDataSource>
    DataFormComboBoxField:
    <telerik:DataFormComboBoxField x:Name="AcademicTitleComboBox" Grid.Column="0" Grid.Row="7" Label="Titel:"                             
                                    ItemsSource="{Binding DataView, ElementName=AcademicTitleDataSource}"
                                    DataMemberBinding="{Binding AcademicTitle}"
                                    SelectedValuePath="ID"
                                    DisplayMemberPath="EntryName" />
    Now i want to display only certain items from the CatalogEntries wherw the CatalogID = 5. How can i filtering the Data?
  2. Harald
    Harald avatar
    48 posts
    Member since:
    Oct 2013

    Posted 20 Sep 2015 Link to this post

    How can I address a field in a RadDataForm per code (C#) if this has been defined using a template in WPF?

     Code like "this.DataFormName.DataFormFieldName." does not work.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 21 Sep 2015 Link to this post

    Hi Harald,

    For this scenario, I suggest you applying IValueConverter to the ItemsSource binding of DataFormComboBoxField and filter the source collection in its Convert() method.

    Does this approach fit your requirements?


    Best Regards,
    Stefan X1
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Harald
    Harald avatar
    48 posts
    Member since:
    Oct 2013

    Posted 03 Oct 2015 in reply to Stefan X1 Link to this post

    Now i created the datasources in the C#-file and bound this datasources to the WPF-Controls. In C# i generate a query for the ComboBox. It works. Thank you.
Back to Top