Using WPF Telerik Radgrid to display data vertically

6 posts, 0 answers
  1. Lax
    Lax avatar
    15 posts
    Member since:
    Mar 2015

    Posted 03 Mar 2015 Link to this post

    I am trying to display data vertically using wpf telerik RadGrid, which needs to be exported to excel in the same layout format. I have set LayoutTransform property of the telerik wpf radgrid to an angle so as to achieve this, but have run into below issues:

    export the data with vertical layout intact,
    grid lines disappeared after applying rotation style to the grid cells,
    unable to hide the row selection highlight,
    horizontal and vertical scrolls are not aligned correctly

    Can someone please help me with these? I am also wondering, if is it preferable to use PivotGrid for such layout?

    Any suggestions would be of great help!

    Thanks in advance, Lax

     

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Mar 2015 Link to this post

    Hello Lax,

    You may try re-defining RadGridView's template in order to adjust it in the way you would like to. Still, this is not an approach we would recommend. As to exporting, you may try manually building the export layout as illustrated on the "SpreadProcessing Integration" WPF Demo. You can also refer to RadPivotGrid examples and online documentation to check how it would work for you.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Lax
    Lax avatar
    15 posts
    Member since:
    Mar 2015

    Posted 04 Mar 2015 in reply to Dimitrina Link to this post

    Thanks for your response, Dimitrina!

    I was able to resolve the grid lines disappearing issue, by modifying the data template for the cell and also could fix the scrollviewer issue by adding the grid inside a scrollerviewer and handling the alignment in the code, as suggested in one of the other posts.

    But as for export, can you please provide me with some working sample of how to assign the RadGridView's layout as is to the IWorkBookFormatProvider? That would be of great help!

    Also, row highlight on hover over of the grid rows needs to disappear, how can I achieve this?

    Thanks,
    Lax
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Mar 2015 Link to this post

    Hi Lax,

    Note that you should not place the GridView inside a ScrollViewer, StackPanel, Grid with Row.Height=Auto or Column.Width=Auto or any container that will measure it with infinity. You can place it in a Grid with Row.Height="*" instead. More on how to increase the performance is described in this performance help article. Having this in mind if you have placed RadGridView in a container that measures it with Infinity, all the rows should be initially realized.

    As to working with IWorkBookFormatProvider, you can take a look at this diagram to learn about the organization of a Workbook object and this article that shows how you can set properties of a cell.

    As to styling GridViewRows, you can refer to the Styling a Row topic in our online documentation. Please note that using Implicit Styles gives you the ability to easily extract and edit the default ControlTemplates of the controls. You can also follow this article on two different approaches on how to extract the ControlTemplates.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Lax
    Lax avatar
    15 posts
    Member since:
    Mar 2015

    Posted 12 Mar 2015 in reply to Dimitrina Link to this post

    Hi Dimitrina,

    Thanks for your inputs!

    I agree with you on the GridView inside a ScrollViewer issue.

    However, we have figured out a way to display data vertically in RadGridView without any of the above mentioned layout changes for RadGridView in xaml. In the new approach, we are using DynamicObject to create grid rows programmatically and assigning the resulting Object to the Itemsource. This way even export works and layout appears as needed. Rest of the formatting to the cell value displaty etc, we have done, in the grid loaded event in the code behind.

    Regards,
    Lax
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Mar 2015 Link to this post

    Hi,

    Thank you for sharing your findings with the community.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top