4 Answers, 1 is accepted
0
Hello Lilia,
Maya
the Telerik team
Please take a look at this forum thread. Does the solution suggested there corresponds to your requirements ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Lilia
Top achievements
Rank 1
answered on 15 Aug 2011, 04:39 PM
Can you give me an example with RadDataFilter. I have this in xaml:
And I've tried to do this in "FilterOperatorsLoading" event, but it didn't do nothing:
<
telerik:RadDataFilter
x:Name
=
"dataFilterSearchCriteria"
EditorTemplateSelector
=
"{StaticResource EditorTemplateSelector}"
AutoGenerateItemPropertyDefinitions
=
"False"
CanUserCreateCompositeFilters
=
"False"
Margin
=
"0,0,0,0"
Canvas.ZIndex
=
"1"
>
<
telerik:RadDataFilter.ItemPropertyDefinitions
>
<
my:ItemPropertyDefinition
DisplayName
=
"Franchise name selector"
PropertyName
=
"Name"
PropertyType
=
"{Binding Source={StaticResource types}, Path=String}"
/>
<
my:ItemPropertyDefinition
DisplayName
=
"Date From"
PropertyName
=
"DateFrom"
PropertyType
=
"{Binding Source={StaticResource types}, Path=DateTime}"
/>
<
my:ItemPropertyDefinition
DisplayName
=
"Date To"
PropertyName
=
"DateTo"
PropertyType
=
"{Binding Source={StaticResource types}, Path=DateTime}"
/>
</
telerik:RadDataFilter.ItemPropertyDefinitions
>
</
telerik:RadDataFilter
>
And I've tried to do this in "FilterOperatorsLoading" event, but it didn't do nothing:
var comboBox = ((RadDataFilter)e.TriggerSource).ChildrenOfType<
RadComboBox
>()
.Where(b => b.Name == "PART_SimpleFilterOperatorComboBox")
.FirstOrDefault();
if (comboBox != null)
{
comboBox.SelectedIndex = 0;
}
0
Lilia
Top achievements
Rank 1
answered on 16 Aug 2011, 10:08 AM
I found my mistake. The problem was that I wasn't selecting the right ComboBox. Here is the right code:
I replaces FirstOrDefault with LastOrDefault to select the last added ComboBox.
var comboBox = ((RadDataFilter)e.TriggerSource).ChildrenOfType<RadComboBox>()
.Where(b => b.Name ==
"PART_SimpleFilterOperatorComboBox"
)
.LastOrDefault();
if
(comboBox !=
null
)
{
comboBox.SelectedIndex = 0;
}
I replaces FirstOrDefault with LastOrDefault to select the last added ComboBox.
0
Hi Lilia,
Ross
the Telerik team
Can you please answer the question that my colleague asked in your other thread first.
Thank you.
Ross
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>