This is a migrated thread and some comments may be shown as answers.

Add ComboBox in AppointmentDialog

6 Answers 224 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Satyendra
Top achievements
Rank 1
Satyendra asked on 25 May 2011, 04:27 PM
I am getting issues in populating ComboBox in AppoinmentDialog window.
I got EditAppointmentDialogStyle source code from RadScheduleView template and edited its EditAppointmentTemplate
I am trying to load Exceptions list in comobox. ExceptionList contains collection of ResourceException type.


<
telerik:RadComboBox x:Name="cmbException" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="0" ItemsSource="{Binding ExceptionList}" Width="210"

SelectedItem="{Binding Occurrence.Appointment.ResourceException, Mode=TwoWay}"/>     

ViewModel is populating ExceptionList but ComboBox is showing nothing, Not sure the way binding to SelectedItem property. Need your help to show data in combobox
Please share code sample how to load data in combobox.

6 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 May 2011, 10:47 AM
Hello Satyendra,

I guess that ExceptionList is a property in your ViewModel used to bind the ScheduleView. But the DataContext of the EditAppointmentDialog is an AppointmentDialogViewModel object -  that's why the binding doesn't work.  In this case you should bind the combobox like this:

<telerik:RadComboBox x:Name="cmbException" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="0" ItemsSource="{Binding ElementName=ScheduleView, Path=DataContext.ExceptionList, Mode=TwoWay}" Width="210"  SelectedItem="{Binding Occurrence.Appointment.ResourceException, Mode=TwoWay}"/>

where ScheduleView is the name of the control:

<telerik:RadScheduleView x:Name="ScheduleView"
AppointmentsSource
="{Binding Appointments}"

EditAppointmentDialogStyle
="{StaticResource EditAppointmentDialogStyle}">
...

Hope this helps.

Regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Satyendra
Top achievements
Rank 1
answered on 26 May 2011, 12:46 PM
Only thing I added is to show Description property in ResourceException class to display in combobox.  
DisplayMemberPath="Description"
  
 Thanks 
0
Satyendra
Top achievements
Rank 1
answered on 06 Oct 2011, 04:32 PM
<telerik:RadComboBox x:Name="cmbException" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="0"  Width="250"  
                    ItemsSource="{Binding ElementName=radSchedule, Path=DataContext.ExceptionList, Mode=TwoWay}" 
                                         DisplayMemberPath="Description" 
                                         SelectedValuePath="AttendCode"
                                         SelectedItem="{Binding Occurrence.Appointment.ResourceException, Mode=TwoWay}" 
                                         SelectedValue="{Binding Occurrence.Appointment.Subject, Mode=TwoWay}"     />

After upgrading to Telerik Q2 release dlls, above code is not populating data in ComboBox. It was working perfect with Q1 dlls.

That might be because of error I am getting in RadSchedulerView templates in  <UserControl.Resources> after upgrading to Telerik Q2 release dlls.
Error 7 Ambiguous type reference. A type named 'InvertedBooleanConverter' occurs in at least two namespaces, 'Telerik.Windows.Controls' and 'Telerik.Windows.Controls'. Consider adjusting the assembly XmlnsDefinition attributes.


0
Maxence
Top achievements
Rank 1
answered on 07 Oct 2011, 01:33 AM
Hi,

same problem for me after upgrading to the last version of telerik silverlight components :

  • If i remove in my page ressources
<telerik:InvertedBooleanConverter x:Key="InvertedBooleanConverter"/>
the design of my page is well displayed in visual studio but an error occurs when trying to open a appointment dialog (double click on an appointment)
  • if i let this, the designer in visual studio doesn't display the page saying the error mentionned by Satyendra (Ambiguous type reference. A type named 'InvertedBooleanConverter' occurs in at least two namespaces, 'Telerik.Windows.Controls' and 'Telerik.Windows.Controls'), but my application works well

My page contains essentially the entire template of radscheduleview (generated by blend), there is a change of this template in last version ?

Also the telerik components are not anymore in my toolbox after the upgrade, but this may be another problem and put in another thread.

Regards,

Maxence
0
Rosi
Telerik team
answered on 10 Oct 2011, 03:09 PM
Hi Maxence,

To solve the issue I suggest you change the line as follows:
OLD
<telerik:InvertedBooleanConverter x:Key="InvertedBooleanConverter"/>

NEW
<schedule:InvertedBooleanConverter x:Key="InvertedBooleanConverter"/>
where:
xmlns:schedule="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"

All the best,
Rosi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Maxence
Top achievements
Rank 1
answered on 10 Oct 2011, 11:00 PM
Hi Rosi,

it works well for me, thanks !

Regards,

Maxence
Tags
ScheduleView
Asked by
Satyendra
Top achievements
Rank 1
Answers by
Yana
Telerik team
Satyendra
Top achievements
Rank 1
Maxence
Top achievements
Rank 1
Rosi
Telerik team
Share this question
or