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

Custom Editors

2 Answers 31 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Lilia
Top achievements
Rank 1
Lilia asked on 28 Jul 2011, 04:15 PM
Hello Telerik team,

I have a RadDataFilter with combo box for custom editor like in your example http://demos.telerik.com/silverlight/#DataFilter/CustomEditors
I'm using the DataFilter in unbound mode so I have a button Search which gets the filters from the filter and initiate a search. My question is how can I get the selected item from the ComboBox in the DataFilter. For example in your example I select 'Crab Meat' from the combobox which has lets say ID=5. In the FilterDescriptors collection in the DataFilter I get the value 'Crab Meat'. How can I get the whole item that is selected from the combobox so I can see that it has ID=5?

2 Answers, 1 is accepted

Sort by
0
Lilia
Top achievements
Rank 1
answered on 29 Jul 2011, 09:55 AM
I managed to get the selected Items like this:

radDataFilter.ChildrenOfType<RadComboBox>()

Is there a better way without browsing through the whole collection of comboboxes?

0
Accepted
Dimitrina
Telerik team
answered on 01 Aug 2011, 02:34 PM
Hello Lilia,

 Generally working with the UI elements (as searching in the Visual Tree) is definitely not a recommended approach as it may lead to future problems. It is better to work with the data elements.

May you please specify what combo box do you mean? If you do mean your custom combo, used for selecting the appropriate data, then you may directly access it. Having a reference to your control allows you to find the info that you need from the selected value.

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
DataFilter
Asked by
Lilia
Top achievements
Rank 1
Answers by
Lilia
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or