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

Resources and GroupDescriptionsSource Databinding

2 Answers 146 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
kjellerik
Top achievements
Rank 1
kjellerik asked on 01 Feb 2011, 09:49 AM
Hi,

I try and databind both resources and GroupDescriptionsSource to a ViewModel and two observable collections. The resources are created at runtime, since it depends on the appointments which is included. I then have a dropdown list to decide which resource the timelineview should be grouped by. 

<telerikSchedulerView:RadScheduleView HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AppointmentsSource="{Binding Sections}" x:Name="radScheduler" ResourceTypesSource="{Binding SchedulerResourcesType}" SelectedAppointment="{Binding SelectedAppointmentItem, Mode=TwoWay}"  GroupDescriptionsSource="{Binding GroupResourceSource, Mode=TwoWay}" SelectedSlot="{Binding SelectedTimeSlot}" >
                <telerikSchedulerView:RadScheduleView.ViewDefinitions>
                    <telerikSchedulerView:TimelineViewDefinition x:Name="timelineViewDefinition" VisibleDays="{Binding VisibleDays, Mode=TwoWay}"  SmallChangeInterval="{Binding SmallChangeInterval}" LargeChangeInterval="{Binding LargeChangeInterval}"  GroupFilter="{Binding GroupFilter}"  />
                </telerikSchedulerView:RadScheduleView.ViewDefinitions>
</telerikSchedulerView:RadScheduleView>
 
<radControl:RadComboBox SelectedItem="{Binding SelectedGroupBy, Mode=TwoWay}" ItemsSource="{Binding SchedulerResourcesType, Mode=TwoWay}" DisplayMemberPath="Name" Style="{StaticResource radComboStyle}" >
                    <radControl:RadComboBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel></VirtualizingStackPanel>
                        </ItemsPanelTemplate>
                    </radControl:RadComboBox.ItemsPanel>
                </radControl:RadComboBox>


public GroupDescriptionCollection GroupResourceSource { get; set; }
public AddRangeObservableCollection<ResourceType> SchedulerResourcesType { get; set; }
 
public ResourceType SelectedGroupBy
        {
            get { return selectedGroupBy; }
            set
            {
                if (selectedGroupBy != value)
                {
                    selectedGroupBy = value;
                    //GroupResourceSource.Clear();
                                         
                    var resoureGroup = new ResourceGroupDescription() { ResourceType = value.Name, ShowNullGroup=false };
                    resoureGroup = view.CreateGroupNames(resoureGroup);                   
                    GroupResourceSource.Add(resoureGroup);
                }
            }
        }

When i add into the GroupResourceSource collection, the scheduler get updated with correct grouping. However instead of showing IResource.DisplayName, it displays a text: MS.Internal.CollectionViewGroupInternal. See image. 

Best Regards
Kjell Erik Reed Anda

2 Answers, 1 is accepted

Sort by
0
kjellerik
Top achievements
Rank 1
answered on 01 Feb 2011, 09:58 AM
saw there was a second post about the same. sorry
0
Valeri Hristov
Telerik team
answered on 01 Feb 2011, 10:14 AM
This issue is fixed in the new build that is already available for download.

Best wishes,
Valeri Hristov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
ScheduleView
Asked by
kjellerik
Top achievements
Rank 1
Answers by
kjellerik
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or