How can we make the NumericButtonCount adjust based on the width of the data pager? Using a constant value for the button count makes the control very awkward for use as most everything else is sized dynamically in a WPF application.
3 Answers, 1 is accepted
0
Maya
Telerik team
answered on 03 Dec 2015, 08:20 AM
Hi Chad,
Please accept my apologies for the late reply.
You can try to handle SizeChanged event of the and based on its width, to decide what NumericButtonCount should be. For example:
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
The approach did cross my mind but then a flurry of alarm bells started ringing in my head :).
As the buttons area is really the only variable size area we should really be able to have it change dynamically with the obvious maxwidth & container constraints. I'm a bit hesitant going the above root for various reasons unless you can provide me with an accurate way to determine button sizes after the various templates and styles have been applied.
Where can I make a suggestion for an option to have the number of buttons determined dynamically?
Regards,
Chad
0
Maya
Telerik team
answered on 08 Dec 2015, 04:29 PM
Hello Chad,
Thanks for the feedback. The thing is the value of NumericButtonCount property can be dynamically set, the size of the buttons can be different based on the theme used or a customization of the template and there is no straightforward and clean way to find buttons' size and calculate the desired count.
Considering getting the buttons, you can work with ChildrenOfType<T> extension method and find them. Then you will be able to calculate their width.
Regards,
Maya
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