icon

4 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
    199 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. UI for WPF is Visual Studio 2017 Ready
  4. 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 ...
  5. Polya
    Admin
    Polya avatar
    199 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.
     
Back to Top