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

Changing data context of RadCombobox

5 Answers 186 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Dheenadhayalan
Top achievements
Rank 2
Dheenadhayalan asked on 18 Jul 2011, 06:53 AM
Hello,

I have been using the Scheduleview for my project. I modified the style of appointmentdialog through EditAppointmentDialogStyle, by changing the subject text block to radcombobox. I wanted to have list of string to be displayed in the combobox so that user can select the subject from the list. But the problem is I am unable to bind the list to the RadCombobox. It is always returning me Binding error. How can i solve this problem?

Thanks in advance,
Dheena

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Jul 2011, 09:10 AM
Hi Dheena,

Please check this help article - it explains how to bind RadComboBox placed in custom EditAppointmentDialog.

All the best,
Yana
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Stephen Tearle
Top achievements
Rank 2
answered on 27 Jun 2012, 12:36 AM
Hi

I have the same problem with not being able to bind a collection to the ItemsSource of a RadComboBox placed inside a custom EditRecurrenceDialog.

I am using MVVM with PRISM.  I have a UserControl called MyView and it's DataContext is MyViewModel.  The DataContext is set in the code behind.  MyView contains the RadScheduleView control, and MyViewModel contains a collection I want to bind to the RadComboBox.

In the linked example in the previous post the ViewModel was set in XAML like this:

<UserControl.Resources>
    <my:MyViewModel x:Key="MyViewModel" />
    ...
</UserControl.Resources>

And the RadComboBox binding like this:

<telerik:RadComboBox ItemsSource="{Binding Source={StaticResource MyViewModel}, Path=ComboBoxItems, Mode=TwoWay}" />


In my case the ViewModel is the DataContext of the View, and is not set as a resource in XAML.  How can I bind my collection to the RadComboBox?

Regards
0
Yana
Telerik team
answered on 29 Jun 2012, 12:26 PM
Hi Stephen,

I am afraid that the only way to bind ItemsSource property to a property in the main ViewModel is setting the ViewModel as a static resource. Since the EditAppointmentDialog is opened in a popup, you will not be able to use a different binding as ElementName, RelativeSource, etc.

I would suggest is to bind the ComboBox ItemsSource to a property in your custom appointment instead. More information how to create a custom appointment can be found here.

Regards,
Yana
the Telerik team

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

0
mike okon
Top achievements
Rank 1
answered on 16 May 2013, 09:10 PM
Hi

I have read through the custom Appointment documentation but have an issue when trying to change the source in the viewmodel of the observable collection to a DB Table

the documentation only shows how to create a list

ComboBoxItems = new ObservableCollection<string>() {
            "item1", "item2", "item3"
        };

When I change this to

ComboBoxItems = new ObservableCollection<Appointments>();

no data is returned, However the appointments appear in the schedule view. I tried to dump the data into a grid view and what does appear are  the Column Headings (ie TimeZone, Resources, etc) This leads me to think somethings a miss??

Can you please provide an example of a RadCombo or rad listbox in a edit appointment dialog which and read data from a table and not just a static list

regards
mike

0
Yana
Telerik team
answered on 20 May 2013, 07:47 AM
Hi Mike,

Please check our reply at the other thread here.

I would kindly ask you not to post the same question in different threads as this slows down our reply.
Thank you for the understanding.

All the best,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
Dheenadhayalan
Top achievements
Rank 2
Answers by
Yana
Telerik team
Stephen Tearle
Top achievements
Rank 2
mike okon
Top achievements
Rank 1
Share this question
or