5 Answers, 1 is accepted
0
Hello,
Ivan Ivanov
the Telerik team
You can use ChildrenOfType<DataFormDataField>(). It is an extension method to DependencyObject and it is located in the Telerik.Windows.Controls namespace, Telerik.Windows.Controls assembly.
Greetings,Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
ITA
Top achievements
Rank 1
answered on 22 May 2013, 02:44 PM
Hi,
I tried this, but without any success:
Test is null! why?
Thanks
best Regards
Rene
I tried this, but without any success:
SelectedValuePath="ID" DisplayMemberPath="Name" DataMemberBinding="{Binding Staat, Mode=TwoWay}" Grid.Row="5" Padding="0" Margin="0,5,0,5" Width="350" Name="Staat1_cbx"
ItemsSource="{Binding Country, Source={StaticResource Test}}" Label="{Binding Source={StaticResource Lang}, XPath=KundenStaat/@Header}" telerik:StyleManager.Theme="Windows8" />
var TEST= this.KundenKontaktForm.ChildrenOfType<
DataFormComboBoxField
>().FirstOrDefault(t => t.Name == "Staat1_cbx");
Test is null! why?
Thanks
best Regards
Rene
0
Hi,
Ivan Ivanov
Telerik
Is this ComboBoxFileld defined in the EditTemplate? If so, it is not yet loaded at this point. Try invoking the retrieving logic through a dispatcher.
Regards,Ivan Ivanov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
ITA
Top achievements
Rank 1
answered on 22 May 2013, 03:08 PM
Hi,
it is loaded, because i try to get this Field on EditEnded of my DataForm. I Change the item in the
combobox and press OK in my DataForm. Than i try to get this Field, but it is null, what ever
i do.
Ok i think i have the Problem. If i use the same Template for "ReadOnlyTemplate" and "EditTemplate", it
works fine. But if i use a different Template for Editmode the Field is null.
Thanks
rene
it is loaded, because i try to get this Field on EditEnded of my DataForm. I Change the item in the
combobox and press OK in my DataForm. Than i try to get this Field, but it is null, what ever
i do.
Ok i think i have the Problem. If i use the same Template for "ReadOnlyTemplate" and "EditTemplate", it
works fine. But if i use a different Template for Editmode the Field is null.
Thanks
rene
0
Hello,
Ivan Ivanov
Telerik
Can you please send us a sample project that illustrates your scenario? We will debug it and send you a modified version back.
Regards,Ivan Ivanov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.