This is a migrated thread and some comments may be shown as answers.
Add RadComboBox to a custom EditAppointmentDialog. What happens if the DataContext is NOT set in XAML?
1 Answer 32 Views
This is a migrated thread and some comments may be shown as answers.
Myles
Top achievements
Rank 1
Myles asked on 16 Apr 2012, 05:23 PM
I need to customise the appointments dialog and this involves adding several additional combobox controls.  I have read the following article:

http://www.telerik.com/help/silverlight/radscheduleview-howto-add-radcombobox-to-editappointmentdialog.html


However, I have a problem as we never set the DataContext of our views in XAML.  I have tried binding the ItemSource of the combobox as follows:

 

 

 

<telerik:RadComboBox Grid.Row="4" Grid.Column="1" ItemsSource="{Binding Path=DataContext.Hauliers, RelativeSource={RelativeSource AncestorType=UserControl}}" />

This doesn't work and I simply get a binding exception.  How can I get the Itemsource binding to work without using a static resource as suggested in the article above?

Regards

Myles J

 

1 Answer, 1 is accepted

Sort by
0
Myles
Top achievements
Rank 1
answered on 17 Apr 2012, 10:19 AM
I resolved this by following the Telerik code sample from the following thread:

http://www.telerik.com/community/forums/silverlight/scheduleview/dynamic-data-loading-in-scheduleview-chiildwindow.aspx

Basically I created my own ViewModel for the Dialog.
Asked by
Myles
Top achievements
Rank 1
Answers by
Myles
Top achievements
Rank 1
Share this question
or