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

Filtering DataFormComboBoxField

3 Answers 48 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Harald
Top achievements
Rank 2
Harald asked on 17 Sep 2015, 07:03 AM
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?

3 Answers, 1 is accepted

Sort by
0
Harald
Top achievements
Rank 2
answered on 20 Sep 2015, 02:03 PM

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.

0
Stefan
Telerik team
answered on 21 Sep 2015, 03:53 PM
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
0
Harald
Top achievements
Rank 2
answered on 03 Oct 2015, 08:51 AM
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.
Tags
DataForm
Asked by
Harald
Top achievements
Rank 2
Answers by
Harald
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or