This is a migrated thread and some comments may be shown as answers.

GridViewDataColumn.Footer Text not visible

12 Answers 213 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 18 Sep 2017, 12:24 PM

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

12 Answers, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 18 Sep 2017, 01:05 PM
Just tried it with the newest version of Telerik. Same behaviour
0
Martin
Telerik team
answered on 21 Sep 2017, 07:32 AM
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
Thomas
Top achievements
Rank 1
answered on 22 Sep 2017, 01:04 AM

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

0
Martin
Telerik team
answered on 24 Sep 2017, 08:37 PM
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
Thomas
Top achievements
Rank 1
answered on 24 Sep 2017, 08:51 PM

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.

0
Stefan
Telerik team
answered on 27 Sep 2017, 03:19 PM
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.
0
Thomas
Top achievements
Rank 1
answered on 27 Sep 2017, 06:52 PM

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.

0
Thomas
Top achievements
Rank 1
answered on 27 Sep 2017, 06:53 PM
Again: Try your example with 30 columns. You will be suprised
0
Martin
Telerik team
answered on 02 Oct 2017, 09:06 AM
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
Thomas
Top achievements
Rank 1
answered on 05 Oct 2017, 08:04 PM

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)

0
Martin
Telerik team
answered on 06 Oct 2017, 07:23 AM
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
Thomas
Top achievements
Rank 1
answered on 07 Oct 2017, 09:23 PM

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.

Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Martin
Telerik team
Thomas
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or