GridViewDataColumn.Footer Text not visible

13 posts, 0 answers
  1. Thomas
    Thomas avatar
    2 posts
    Member since:
    Sep 2017

    Posted 18 Sep Link to this post

    I use the GridViewDataColumn.Footer to display some overall information.
    With this code:

                    <telerik:GridViewDataColumn.Footer>
                        <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=local:BaseModuleDetail, Mode=FindAncestor}, Path=DataContext.DataSum.Sum}" />
                    </telerik:GridViewDataColumn.Footer>

    It works flawlessly. While our GridView has over 20 columns the user has to scroll to see through the whole content.
    Only the Footer content of the firstly visible columns are rendered perfectly. After scrolling horizontally, the other footers content is empty.
    The other column's footer row binding is correct and has valid data. (If I set the first 5 columns invisible, the next 5 columns, now visible within the viewport, are going to be rendered perfectly). Therefore, I have to assume this is a bug within the framework.

    Telerik version: 2015.3.1104.45

  2. Thomas
    Thomas avatar
    2 posts
    Member since:
    Sep 2017

    Posted 18 Sep Link to this post

    Just tried it with the newest version of Telerik. Same behaviour
  3. Martin Vatev
    Admin
    Martin Vatev avatar
    129 posts

    Posted 21 Sep Link to this post

    Hi Thomas,

    This behavior is due to the virtualization nature of RadGridView. In order to display some overall information, you can use Column footers but by defining aggregate functions. Please take a look at our Aggregate Functions article where you can find detailed information on the matter.

    I hope that this helps.

    Regards,
    Martin Vatev
    Progress Telerik
    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.
  4. Thomas
    Thomas avatar
    9 posts
    Member since:
    Feb 2014

    Posted 21 Sep Link to this post

    Thanks. That solved the problem.

    Is there any "aggregate function" to just display a single value?
    Actually, I do not want to sum anything up. There is already an object including the information I would like to display at the bottom of each column, which is not related to the data within the cells.

    I am not able to check out the examples at http://demos.telerik.com/silverlight/#GridView/CustomAggregates because of the lack of silverlight. (Did install it, but still have troubles with it) Do you mind posting an example of how to create such an aggreate function?

    Thanks in advance

  5. Martin Vatev
    Admin
    Martin Vatev avatar
    129 posts

    Posted 24 Sep Link to this post

    Hi Thomas,

    For your convenience, I prepared an example to demonstrate how to achieve the desired behavior. Please take a look at the implementation and consider how this approach fits your scenario.

    I hope that this helps. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Martin Vatev
    Progress Telerik
    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.
  6. Thomas
    Thomas avatar
    9 posts
    Member since:
    Feb 2014

    Posted 24 Sep in reply to Martin Vatev Link to this post

    Thanks for your help. Your example is exactly what I have already done (see first post).
    With this approach and virtualization mode enabled, the footer row's content is not visible.
    I hope my concern is now a bit clearer.

  7. Stefan
    Admin
    Stefan avatar
    771 posts

    Posted 27 Sep Link to this post

    Hello Thomas,

    Thanks for the update.

    I tested the project provided by my colleague and it seems to be showing the content of the footer row as expected. Attached to my reply you can find an image as a demonstration. Can you please clarify whether you have some additional styles applied that might be causing such visual appearance?

    Regards,
    Stefan X1
    Progress Telerik
    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.
  8. Thomas
    Thomas avatar
    9 posts
    Member since:
    Feb 2014

    Posted 27 Sep in reply to Stefan Link to this post

    Hi Stefan!

    It seems like I did not explain my problem in detail.
    Again:

     

    Aim:

    - Use Column and Row Virtualization
    - Use Custom Footer Bindings (Do NOT aggregate the cell's values, since I would like to display an arbitrary value in the footer line which is NOT present in the cells => Binding)
    - Use more than 20 columns, because I have to display such a variety of information

    Problem:
    - When working with GridViewDataColumn.Footer (see code below) not all the footer row's content is visible. (Due virtualization)
    When I turn column virtualization off, all the footer's content will be visible.
    - I can't use an aggregate function, because I don't want to aggregate anything. I just want to bind a custom value, not present in the gridview.

    <telerik:GridViewDataColumn.Footer>
                        <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=local:BaseModuleDetail, Mode=FindAncestor}, Path=DataContext.DataSum.Sum}" />
                    </telerik:GridViewDataColumn.Footer>

     

    So, in my first post already explaind that I am aware of the code above. And it does work, if no horizontally scrolling is needed.
    The answer to my problem was: Use Aggregate functions.
    Since I have no clue how an aggregate function is able to display an arbitrary value, I asked for an example.
    What I got is, again, what I already know and what is currently not working.

     

    And Stefan X1 example is NOT working, if you use many columns.

  9. Thomas
    Thomas avatar
    9 posts
    Member since:
    Feb 2014

    Posted 27 Sep in reply to Stefan Link to this post

    Again: Try your example with 30 columns. You will be suprised
  10. Martin Vatev
    Admin
    Martin Vatev avatar
    129 posts

    Posted 02 Oct Link to this post

    Hello Thomas,

    I tried our example with 30 columns and everything works as expected. The difference between our implementation and the implementation of your project is that for the source property of the binding is used not a relative source but as a static resource. Please take a look at it again and let me know if this approach fits your scenario.

    Regards,
    Martin Vatev
    Progress Telerik
    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.
  11. Thomas
    Thomas avatar
    9 posts
    Member since:
    Feb 2014

    Posted 05 Oct in reply to Martin Vatev Link to this post

    This approach does not fit my scenario. I made up an example illustrating the issue.

    Please take a look at it and let me know what you think about it. Maybe it is a restriction or limitation.

    (Since I am not able to upload a .zip with a example project, I just attach a link to my onedrive)

    https://1drv.ms/u/s!AndqqCq6k0A9ltYetFWJsVTwg0kxXA

    (Img1: Startup. Img2: Scrolling)

  12. Martin Vatev
    Admin
    Martin Vatev avatar
    129 posts

    Posted 06 Oct Link to this post

    Hello Thomas,

    I reworked the attached project to demonstrate how exactly the desired behavior can be achieved when the virtualization of RadGridView is on. The only modification is that the footer is created as a style but not directly. The unexpected behavior is caused by the virtualization nature of the control. Please take a look at the approach and consider if it is helpful. 

    I hope that this helps.

    Regards,
    Martin Vatev
    Progress Telerik
    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.
  13. Thomas
    Thomas avatar
    9 posts
    Member since:
    Feb 2014

    Posted 07 Oct in reply to Martin Vatev Link to this post

    Hello Martin!

    Thank you very much. This solves my problem.
    I guess I have to stick to this "hack". However, this behaviour seems, at least for me, not logical. (StaticResources are working)

    Anyway, thanks for solving the issue.

Back to Top