Resource Label on the left side


Hello,

Is there a way to change the position of the resource label on GanttControl to the left side of the task's rectangle?


Thank you!

1 Reply 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team June 3, 2021 09:00 AM UTC

Hi Lívio Tonini Gouveia e Silva,

Query: Is there a way to change the position of the resource label on GanttControl to the left side of the task's rectangle?
Yes. we can customize the label position by customizing the Gantt node template  as per the below code snippet

[XAML]:

    <syncfusion:GanttControl x:Name="GanttControl" ItemsSource="{Binding TaskDetails}"

                                 HorizontalAlignment="Stretch"

                                 VerticalAlignment="Stretch" WeekBeginsOn="Monday">

            <syncfusion:GanttControl.Resources>

 

  ..

       

                <Style TargetType="chart:GanttNode">

                    <Setter Property="HorizontalAlignment" Value="Left"/>

                    <Setter Property="Template">

                        <Setter.Value>

                            <ControlTemplate TargetType="chart:GanttNode">

                                <Canvas Height="11">

                                    <Ellipse Cursor="Hand" x:Name="PART_LeftTouchPoint" Height="10" Width="10" Canvas.Left="-20" Canvas.Top="0.5"

                                 Fill="Black" Visibility="Hidden"></Ellipse>

                                    <Ellipse Cursor="Hand" x:Name="PART_RightTouchPoint" Height="10" Width="10" Canvas.Right="-20" Canvas.Top="0.5"

                                 Fill="Black" Visibility="Hidden"></Ellipse>

                                    <Label Content="{Binding TaskName}" Canvas.Top="-10" Canvas.Left="-30"></Label>

 ...

                                </Canvas>

...

                            </ControlTemplate>

                        </Setter.Value>

                    </Setter>

                </Style>


Screenshot:

Please have a sample from the below link

https://www.syncfusion.com/downloads/support/directtrac/general/ze/Gantt104723428

For more information about Gantt node style
https://help.syncfusion.com/wpf/gantt/custom-node-style

Let us know if you need any further assistance.

Regards,
Sridevi S.

 


Marked as answer
Loader.
Up arrow icon