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

Selected Task problem when using Originalvent

3 Answers 55 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Prolay
Top achievements
Rank 1
Prolay asked on 02 Jan 2013, 09:54 AM
Hi

When I am using "OriginalEvent" to display a column by setting the column's cell template. The column is rendered properly but when the task is selected the text of the column goes blank. I have attached a screenshot.


<telerik:ColumnDefinition MemberBinding="{Binding EstimatedHours,Converter={StaticResource DurationConverter}, ConverterParameter=D}" Header="Est Hrs" ColumnWidth="50">
    <telerik:ColumnDefinition.CellTemplate>
        <DataTemplate>
            <TextBlock TextAlignment="Right" VerticalAlignment="Center" Text="{Binding OriginalEvent.EstimatedHours,Converter={StaticResource DurationConverter}, ConverterParameter=D}"/>
        </DataTemplate>
    </telerik:ColumnDefinition.CellTemplate>
    <telerik:ColumnDefinition.CellEditTemplate>
        <DataTemplate>
            <telerik:RadMaskedTextBox x:Name="txtEstimatedHrs" Value="{Binding EstimatedHours,Mode=TwoWay}" Mask="n" MaskType="Numeric" />
        </DataTemplate>
    </telerik:ColumnDefinition.CellEditTemplate>
</telerik:ColumnDefinition>



Regards,
Prolay

3 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 02 Jan 2013, 12:38 PM
Hello Prolay,

I tried the scenario you described, but I couldn't reproduce the problem. Could you please check the attached project and let me know if I'm missing something?

I also demonstrated a second approach that will let you align your cells to the right, but with a little better performance than using the OriginalEvent property - using MemberBinding combined with the FormattedValue.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Prolay
Top achievements
Rank 1
answered on 04 Jan 2013, 11:04 AM
Hi Miroslav,

When I searched a bit. the problem is because of this particular style. For time being I have commented out this code. Can you help me in understanding the problem with this style.

<Style x:Key="SimpleCellContainerStyle" TargetType="Control">
    <Setter Property="MinHeight" Value="24" />
    <Setter Property="gantt:TreeCellContainer.LevelOffset" Value="15" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Padding" Value="5 0" />
    <Setter Property="scheduling:ZIndexManager.ZIndex" Value="30" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Control">
                <TextBlock Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="ValueTextBlock" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Thanks and Regards,
Prolay
 
0
Miroslav Nedyalkov
Telerik team
answered on 04 Jan 2013, 01:01 PM
Hello Prolay,

The style you sent seems correct to me and I cannot tell what goes wrong with it.

Greetings,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GanttView
Asked by
Prolay
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Prolay
Top achievements
Rank 1
Share this question
or