icon

6 posts, 0 answers
  1. robert
    robert avatar
    27 posts
    Member since:
    Aug 2011

    Posted 07 Jul 2014 Link to this post

    hello, is it possible to add a Picture/Icon for each Task at gridview part side?
    I attempted to bind the Image with a datatemplate under columndefinition for the task
    but without success.

    <telerik:ColumnDefinition MemberBinding="{Binding TaskImage}" Width="AutoHeaderAndContent">
                                         <telerik:ColumnDefinition.CellEditTemplate>
                                             <DataTemplate>
                                                 <Image Source="{Binding TaskImage}" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform"/>
                                                 <!--<Image Source="../Images/folder_16.png" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform"/>-->
                                             </DataTemplate>
                                         </telerik:ColumnDefinition.CellEditTemplate>
                                     </telerik:ColumnDefinition>


    greetings Robert ...

  2. Polya
    Admin
    Polya avatar
    219 posts

    Posted 08 Jul 2014 Link to this post

    Hi Robert,

    You are on the right track on how to achieve an Image Column in the GridView part of the RadGanttView.
    To accomplish this we need to add a ColumnDefinition with a custom CellTemplate to the RadGanttView. In the CellTemplate however we should use FormattedValue property instead of the TaskImage property.

    Please find attached a sample project demonstrating how to achieve this. I have created an ImageGanttTask that extends the GanttTask by adding an ImagePath property. Then in the xaml I add a ColumnDefinition to the RadGanttView with the custom CellTemplate. This template contains an Image bound to the ImagePath property.

    Regards,
    Polya
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. robert
    robert avatar
    27 posts
    Member since:
    Aug 2011

    Posted 09 Jul 2014 Link to this post

    Thank you for your help and sample. It work's now.
    Is it also possible to use a Icon at gantview side e.g display at left side from a gantbar?
    greetings Robert ...
  4. Polya
    Admin
    Polya avatar
    219 posts

    Posted 10 Jul 2014 Link to this post

    Hello Robert,

    If I understood correctly the desired customization includes adding the Icon in the GanttTasks in the TimeRuler part of the RadGanttView.
    If I am correct, this can be achieved by modifying the ControlTemplate of the EventContainers to include an additional Image.
    I've attached the modified project that demonstrates how to achieve the above approach. Note that the project uses Implicit Styles.
    More information about styling and theming the RadGanttView can be found on this link.

    Regards,
    Polya
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. Andrea
    Andrea avatar
    3 posts
    Member since:
    Aug 2016

    Posted 08 May Link to this post

    Following the previous example, I would like to achieve the result in the attached image. I would like to be able to add some icons at the right side of the red/green deadline indicator.
    Can you please help me with an example on how to do that?

    Thanks

  6. Polya
    Admin
    Polya avatar
    219 posts

    Posted 10 May Link to this post

    Hi Andrea,

    RadGanttView provides a way to display custom elements for each task in the Timeline showing additional information.
    The approach is demonstrated in our WPF Demos - just check the GanttView Deadline example. This approach consists of:
     1. Creating a custom GanttTask and added a, for example, GanttResource property to it.

     2. Creating a custom EventInfo (for example, TimeLineResourceEventInfo) that contains the relevant information about the new container you want to add.

     3. Creating the custom container (for example, TimeLineResourceContainer) that you want to add and define style for it.

     4. Creating a custom ContainerSelector and in its overriden GetContainerType() method return a TimeLineResourceContainer when the passed item is of type TimeLineResourceEventInfo.

     5. Creating custom DefaultGanttTimeLineVisualizationBehavior (for example, ResourceTimeLinVisualizationBehavior) that answer for generating the correct EventInfos for each GanttTask. In its overriden GetEventInfos() method create a TimeLineResourceEventInfo for each container. Note that the range of the TimeLineResourceEventInfostarts at from the end of the task.

    Hope this helps.

    Regards,
    Polya
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top