Selected Task problem when using Originalvent

4 posts, 1 answers
  1. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 02 Jan 2013 Link to this post

    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
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 02 Jan 2013 Link to this post

    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.

  3. DevCraft banner
  4. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 04 Jan 2013 Link to this post

    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
     
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 04 Jan 2013 Link to this post

    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.

Back to Top