Page Header Bindings using PageNumber function

1 Answer 20 Views
Binding Expressions
Gerald
Top achievements
Rank 1
Gerald asked on 11 Mar 2024, 04:09 PM | edited on 14 Mar 2024, 12:08 PM

In my PageHeader I can use the PageNumber function to display the PageNumber grouped by any staff like "= PageNumber('headerGroup', Fields.MyField)".
But when I try to use this Expression to Bind the Height of the PageHeaderSection, I got Null with the above Expression insteat of the expected PageNumber.

The Binding Code is like that:

Bindings.Add(new Binding("Height", "= IIF(PageNumber('headerGroup', Fields.MyField) = 1, '10cm', '4cm')"));
 

What am I doing wrong?

A Binding like

Bindings.Add(new Binding("Height", "= IIF(PageNumber = 1, '10cm', '4cm')"));

works well.

Thanks for your support.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Mar 2024, 12:12 PM

Hello Gerald,

Thank you for the provided information!

There are some known problems with using the PageNumber function with a group scope to hide the page header section or to dynamically set its height. I have cast your vote for the following feedback item to increase its priority - Page sections take up space even when they are hidden when using the PageNumber function with a group scope to control visibility (telerik.com).

The problem appears only when the expression is used within a binding because the expression scope is changed to the parent item there, you may refer to the Expression/Data Scope Explained - Telerik Reporting article for more information on this topic.

The only option here is to use the PageNumber object without specifying a scope. I hope that this will work for you.

Please accept our apologies for the caused inconvenience.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
Binding Expressions
Asked by
Gerald
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or