We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tasknode Template

Thread ID:

Created:

Updated:

Platform:

Replies:

142124 Jan 21,2019 11:28 AM UTC Jan 23,2019 09:35 AM UTC WPF 3
loading
Tags: GanttControl
Daniel Pagano
Asked On January 21, 2019 11:28 AM UTC

Good afternoon,

I would like to ask you if it is possible to set, in the scheduling view, 2 task in line and apply a different template to each one.

I would like to achieve something like you can see on the following image, but instead having the milestone I would like to have an image.



I look forward to your reply.

Best regards,

Daniel

Attachment: syncfusion_example_a86eb8f5.7z

Muneesh Kumar G [Syncfusion]
Replied On January 22, 2019 12:26 PM UTC

Hi Daniel, 
 
Greetings from Syncfusion. 
 
We have analysed the reported query and we suspect that you are using resource view gantt in your application. You can add multiple task in a single row as per the below code snippet. 
 
Code snippet: 
MainWindow.Xaml  
<gantt:GanttControl x:Name="Gantt" 
                                ItemsSource="{Binding TeamDetails}" 
                                ShowDateWithTime="True" 
                                ShowNonWorkingHoursBackground="False" 
                                ShowChartLines="False" 
                                ToolTipTemplate="{StaticResource toolTipTemplate}" 
                                VisualStyle="Metro">
  <gantt:GanttControl.TaskAttributeMapping> 
                    <gantt:TaskAttributeMapping TaskNameMapping="Name" 
                                                StartDateMapping="StartDate"  
                                                ChildMapping="SubItems" 
                                                FinishDateMapping="FinishDate" 
                                                ProgressMapping="Progress" 
                                                InLineTaskMapping="InLineItems"/> 
                </gantt:GanttControl.TaskAttributeMapping>

MainWindow.Xaml.cs
public
ObservableCollection<Item> GetTeamInfo() 
        { 
            DateTime dtS = DateTime.Today; 
 
            ObservableCollection<Item> teams = new ObservableCollection<Item>(); 
 
            teams.Add(new Item() { Name = "RDU Team" }); 
            Item Person = new Item() { Name = "Robert" };
// Milestone
 
            Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 07), FinishDate = new DateTime(2012, 01, 07), Name = "Market Analysis", Progress = 50d }); 
            Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 11,12,0,0), FinishDate = new DateTime(2012, 01, 17), Name = "Competitor Analysis", Progress = 20d }); 
            Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 17,12,0,0), FinishDate = new DateTime(2012, 01, 21), Name = "Design Spec" }); 
            teams[0].SubItems.Add(Person); 
   return teams;
       }
 
 
 
We have prepared a sample by adding a Milestone and a task in a single row as like your given image. Please check the sample from the following link.  
 

Screenshot:


Please check our UG documentation link to know more about Resource view gantt items

 
https://help.syncfusion.com/wpf/gantt/resource-view-gantt-inline-items

If your requirement different than this, please give more information about your requirement that would be helpful for us to give better solution in this.
 
 
Regards, 
Muneesh Kumar G. 
 


Daniel Pagano
Replied On January 22, 2019 01:14 PM UTC

Hi Muneesh Kumar G.,

Thank you for your answer, but I was asking you if it is possible to have 2 task in the same row and with different templates.

As you can see in the image that i sent you yesterday I would like to achieve:

2 task in line, but the firstone instead of a milestone I would like to have an image.

Muneesh Kumar G [Syncfusion]
Replied On January 23, 2019 09:35 AM UTC

Hi Daniel, 

Thanks for your update. We have analysed the reported requirement, and this can be achieved by adding a new template for Milestone Style and add image in that style for displaying image instead of milestone.  
 
Code snippet: 
<Style x:Key="MileStone" TargetType="gchart:MileStone"> 
            <Setter Property="Template"> 
                <Setter.Value> 
                    <ControlTemplate TargetType="gchart:MileStone"> 
                        <Grid> 
                            <Image Source="image.png" Height="19" Width="19"/> 
                        </Grid> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter>
</
Style>
    <gantt:GanttControl.Resources> 
                <Style BasedOn="{StaticResource MileStone}" TargetType="gchart:MileStone" /> 
            </gantt:GanttControl.Resources> 
 
 
Sample:  
 
Screenshot:


Check our following UG documentation link for how to add custom node style for header, gantt and milestone

https://help.syncfusion.com/wpf/gantt/custom-node-style

Please let us know if you have any other queries.

Regards,
 
Muneesh Kumar G.  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon