Hi to all,
I'm trying to use an EditTemplateSelector, but I have problem to retrieve DataContext of RadWindow, my RadWindow has x:Name="radWindow", its relative ViewModel exposes a List<T> collection called StatiCertificato, it seems that it not found it.
When selector use campoEditTesto it works correctly and it works correclty with campoEditData also, when it uses campoEditStato or campoEditDecisione show me correctly RadComboBox but without items. It checked that my collection are full.
Am I using a wrong approach for binding into ItemSource property? If yes, what's wrong?
<
templateSelector:ValoreEditTemplateSelector
x:Key
=
"campiEditTemplateSelector"
>
<
templateSelector:ValoreEditTemplateSelector.campoEditTesto
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding Valore,Mode=TwoWay}"
/>
</
DataTemplate
>
</
templateSelector:ValoreEditTemplateSelector.campoEditTesto
>
<
templateSelector:ValoreEditTemplateSelector.campoEditStato
>
<
DataTemplate
>
<
telerik:RadComboBox
ItemsSource
=
"{Binding StatiCertificato, ElementName=radWindow}"
SelectedItem
=
"{Binding StatoCertificatoSelezionato,Mode=TwoWay}"
DisplayMemberPath
=
"Descrizione"
SelectedValuePath
=
"Valore"
/>
</
DataTemplate
>
</
templateSelector:ValoreEditTemplateSelector.campoEditStato
>
<
templateSelector:ValoreEditTemplateSelector.campoEditDecisione
>
<
DataTemplate
>
<
telerik:RadComboBox
ItemsSource
=
"{Binding DecisioniCertificato, ElementName=radWindow}"
SelectedItem
=
"{Binding DecisioneCertificatoSelezionato,Mode=TwoWay}"
DisplayMemberPath
=
"Descrizione"
SelectedValuePath
=
"Valore"
/>
</
DataTemplate
>
</
templateSelector:ValoreEditTemplateSelector.campoEditDecisione
>
<
templateSelector:ValoreEditTemplateSelector.campoEditData
>
<
DataTemplate
>
<
telerik:RadDatePicker
SelectedValue
=
"{Binding Valore, Mode=TwoWay, Converter={StaticResource editDateConverter}}"
/>
</
DataTemplate
>
</
templateSelector:ValoreEditTemplateSelector.campoEditData
>
</
templateSelector:ValoreEditTemplateSelector
>