Print Preview Grid Hierarchy showing HierarchyChildTemplate expanded

5 posts, 1 answers
  1. Darky
    Darky avatar
    2 posts
    Member since:
    Jun 2010

    Posted 14 Sep 2010 Link to this post

    Hi, i need show the print preview of one Grid Hierarchy, i find some examples but only show the first level. When HierarchyChildTemplate is open in the grid not show the others levels...

    How can show the print preview with HierarchyChildTemplate expanded?...

    thanks..

    Add picture...
  2. Answer
    Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 15 Sep 2010 Link to this post

    Hello Darky,

     If you wish to print the grid hierarchy (assuming you're using PrintExtensions.cs from our demos), you should modify the ToPrintFriendlyGrid method to insert:

    grid.HierarchyChildTemplate = source.HierarchyChildTemplate;
     
    foreach (var definition in source.ChildTableDefinitions)
    {
       grid.ChildTableDefinitions.Add(definitions);
    }
     
    grid.ExpandAllHierarchyItems();

    before the "StyleManager.SetTheme(grid, StyleManager.GetTheme(grid));" line.

    Greetings,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Darky
    Darky avatar
    2 posts
    Member since:
    Jun 2010

    Posted 15 Sep 2010 Link to this post

    Thank you for your reply. It works fine...
  5. Sureshbabu
    Sureshbabu avatar
    2 posts
    Member since:
    Jan 2016

    Posted 07 Jan Link to this post

    Hi Yavor Georgiev,

    I do have the same issue. Even after inserting the grid.ExpandAllHierarchyItems(); code I am not able to see the Child elements of the Hierarchical Items. Is there anything I am missing? Please help.

     

     

  6. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 12 Jan Link to this post

    Hello Sureshbabu,

    Unfortunately, the approach discussed in the current thread is no longer available for print previewing hierarchical RadGridView as advised in the following thread -  RadGridView Print and Print Preview.  I need to inform you that there is no out of the box implementation that you can use in order to achieve the desired behavior and you will need to come up with a custom logic from your side.  I suggest you review the following demo - RadGridView Export and Print through RadDocument - which you can find in our demo application - http://demos.telerik.com/wpf/.

    I have created a sample project, based on the demo, that implements some custom logic on exporting the expanded child grids, however, the approach is not generic and I am sending it just for your reference. Once you have reviewed it you can consider implementing something similar in your project.

    If you have any further questions or concerns, do not hesitate to contact us.

    Regards,
    Stefan Nenchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready