ListBox ItemsSource in CustomAppointmentDialg

2 posts, 0 answers
  1. Gts
    Gts avatar
    17 posts
    Member since:
    Jul 2012

    Posted 17 Apr 2014 Link to this post

    Hi.
    I have custom appointment class
    public class MyAppointment:Appointment
    {
             private List<AppointmentOcurence> _appointmentInterval; 
             public List<AppointmentOcurence> AppointmentInterval
            {
                get { return this.Storage<MyAppointment>()._appointmentInterval; }
                set
                {
                    var storage = this.Storage<MyAppointment>();
                    if (storage._appointmentInterval != value)
                    {
                        storage._appointmentInterval = value;
                        this.OnPropertyChanged(() => this.AppointmentInterval);
                    }
                }
            }
    ....
    }

    And I have dialog Template

    <ControlTemplate x:Key="EditAppointmentTemplate" TargetType="telerik:SchedulerDialog">
    ..........................
     
    <telerik:RadListBox Height="300" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3"
                                        ItemsSource="{Binding Occurrence.Appointment.AppointmentInterval, Mode=TwoWay}"
                                       >
                        <telerik:RadListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding SchedulerName}"/>
                            </DataTemplate>
                        </telerik:RadListBox.ItemTemplate>
                    </telerik:RadListBox
     
    ................................
    </ControlTemplate>

    But when I open dialog I didn't see ant data in ListBox.
    Debugger didn't show any bindings error but ListBox didn't show any data
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 21 Apr 2014 Link to this post

    Hi Artem,

    I have tested the provided code in a simple project and the ListBox inside EditAppointmentDialog is bound without a problem. I have attached the test project, can you download it and give it a try?
    What is different in your case?

    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
Back to Top