Add RadComboBox to a custom EditAppointmentDialog. What happens if the DataContext is NOT set in XAML?

2 posts, 0 answers
  1. Myles
    Myles avatar
    18 posts
    Member since:
    Mar 2012

    Posted 16 Apr 2012 Link to this post

    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

     

  2. Myles
    Myles avatar
    18 posts
    Member since:
    Mar 2012

    Posted 17 Apr 2012 Link to this post

    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.
  3. DevCraft banner
Back to Top