Access controls of EditAppointmentDialog

6 posts, 0 answers
  1. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 03 Apr 2014 Link to this post

    There used to be an article at http://www.telerik.com/help/silverlight/radscheduler-how-to-access-the-controls-in-the-editappointmentdialog.html that sounded exactly like what I needed, but the link is dead now. Has it moved?

    Regardless, I have a custom appointment dialog with a RadListView of resources I would like to filter based on a RadComboBox in the same dialog (in an MVVM way). I can pre-populate the lists during Appointment_Creating and Appointment_Editing just fine, but how would I alter the values of those controls while the dialog is open? I'm using EventTriggers for other activities and that seemed reasonable, but those are a) outside of the appointment dialog itself (which is a very magical beast indeed) and b) I'm just not understanding how to reference the controls in the currently open dialog.

    <telerik:RadComboBox x:Name="filter_Devices_List"
                            Grid.Row="1"
                            Grid.Column="2"
                            Margin="5,5,10,0"
                            ItemsSource="{Binding Occurrence.Appointment.LocationFilter}"
                            SelectedItem="{Binding Occurrence.Appointment.SelectedLocationFilter, Mode=TwoWay}"
                            SelectedValuePath="ID"
                            DisplayMemberPath="Name">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="SelectionChanged">
                <ei:CallMethodAction TargetObject="{Binding}"
                             MethodName="UpdateLocationFilter" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
    </telerik:RadComboBox>
    <telerik:RadListBox x:Name="_available_Devices_List"
                        Grid.Row="2"
                        Grid.Column="2"
                        Margin="5,0,10,5"
                        ItemTemplate="{StaticResource AvailableDevicesListItemTemplate}"
                        ItemsSource="{Binding Occurrence.Appointment.AvailableDevices}"
                        SelectedItem="{Binding Source={StaticResource ReservationDialogViewModel}, Path=SelectedAvailableDevice, Mode=TwoWay}"
                        SelectedValuePath="ID"></telerik:RadListBox>


  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 07 Apr 2014 Link to this post

    Hi Art,

    The mentioned article was for the old RadScheduler control which is not available any more.

    First, I'd like to note that EditAppointmentDialog is actually RadWindow and as such it it not in the same visual tree as the page, so the controls in it cannot be directly referenced.
    However, I would suggest that you take a look at the following Code Library project:
    How to Create Advanced Custom EditAppointmentDialog

    which demonstrates a similar approach - how to update a property in the dialog based on the changes of another property.

    Try it and if you have any issues/questions, let us know.

    Regards,
    Yana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 07 Apr 2014 in reply to Yana Link to this post

    Do all the objects I want to manipulate need to be in the viewmodel of the RadWindow? Specifically, the ObservableCollection<> that populates the combobox, the object for the SelectedItem, as well as the ObservableCollection<> that is then filtered? 
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Apr 2014 Link to this post

    Hello Art,

    The purpose of the EditAppointmentDIalog is to show the appointment properties, so you should either create a custom Appointment with these properties or add them to the dialog ViewModel. 

    Regards,
    Yana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 09 Apr 2014 in reply to Yana Link to this post

    I have both a custom Appointment object AND a customized dialog ViewModel already. My confusion is: where is the best place to put the logic for the behavior I'm looking for? Specifically, within the custom appointment dialog, I want to filter a RadListBox using a RadComboxBox (see image). I've tried a number of different methods that should have worked, based on what you've said, but none do. 
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 14 Apr 2014 Link to this post

    Hi Art,

    Could you please isolate the scenario in a simpler project and send it to us, so we to be able to research the case further? You should open a support ticket and attach it there.

    Thanks in advance.

    Regards,
    Yana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner