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

Error in TimeRulerTemplateSelector

1 Answer 63 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 12 Sep 2011, 09:35 AM
Hi,

I have a problem since I upgrated from version 2010.3.1314.35 to 2011.2.712.40.
In my scenario I have a "special" TimeRulerItemTemplateSelector which displays a progressbar (status for each day).
With version 2010.3.1314.35 the value-binding (Value="{Binding DateTime, Converter={StaticResource GetDateValue}}") works fine, version 2011.2.712.40 fired the following error:

TwoWay- oder OneWayToSource-Bindungen funktionieren nicht mit der schreibgeschützten Eigenschaft "DateTime" vom Typ "Telerik.Windows.Controls.ScheduleView.TimerRulerItemProxy".

my sources:

            <telerik:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
                <DataTemplate>
                    <Grid Height="60">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Text="{Binding DateTime, Converter={StaticResource GetWeekDay}}"/>
                        <TextBlock Grid.Row="1" Text="{Binding DateTime, Converter={StaticResource GetDateShort}}"/>
                        <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="2,0,0,0">
                            <ProgressBar Width="40" Minimum="0" Maximum="100" Value="{Binding DateTime, Converter={StaticResource GetDateValue}}"/>
                            <TextBlock Text="{Binding DateTime, Converter={StaticResource GetDateValue}}"/>
                            <TextBlock Text="%"/>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </telerik:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>

and the GetDateValue Function:

Public Class GetDateValue
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        If TypeOf value Is DateTime Then
            Dim dt As DateTime = DirectCast(value, DateTime)
            value = 50   'only for demo...
        End If
        Return value

    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Throw New NotImplementedException()
    End Function

End Class

with best regards,
Stefan

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 12 Sep 2011, 10:25 AM
Hi Stefan,

Since this inquiry of yours is replied to in another thread, please use that thread for reference.

Best wishes,
Dani
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
ScheduleView
Asked by
Stefan
Top achievements
Rank 1
Answers by
Dani
Telerik team
Share this question
or