Declined
Last Updated: 04 Nov 2019 12:59 by ADMIN
wu
Created on: 04 Oct 2019 01:27
Category: UI for WPF
Type: Bug Report
0
The Pivot control column header width problem

    For the Pivot control,if the group header width greater than the first column width,when start the app,
the first column width will expand the group header width(like the attach file "Start.png"),
instead of it self width (like the attach file "ResizeColumn.png",it is our desired),moreover,when resize the column width,like the attach file "ResizeColumn.png",
then Collapse,the result like the attach file "Collapse.png",but not our desired the group header width(should not cover the text).

2 comments
ADMIN
Dilyan Traykov
Posted on: 04 Nov 2019 12:59

Hello,

I'm closing this item for now, but if you come across any issues or if any questions or concerns arise, do not hesitate to contact us again.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Dilyan Traykov
Posted on: 09 Oct 2019 14:48

Hello Wu,

Thank you for the provided images.

If I understood your requirement correctly, you wish the width of the group header to increase to accommodate its content when it is collapsed. This, however, is not expected with the current implementation of the control as the group header changes its width when its subheaders are resized. Take for example the case when both subheaders' width is smaller than that of the group header (and it is cut before collapsing it). It would not be expected for the header to resize once it is expanded as the new width would differ from its initial width.

You can, however, achieve your requirement by handling the MouseLeftButtonDownEvent of the PivotGroupHeader in the following manner:

    public partial class App : Application
    {
        static App()
 {
            EventManager.RegisterClassHandler(typeof(PivotGroupHeader), PivotGroupHeader.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnHeaderClicked), true);
 }

        private static void OnHeaderClicked(object sender, MouseButtonEventArgs e)
 {
            var header = sender as PivotGroupHeader;
            if (!header.IsExpanded)
            {
                header.GetType().GetMethod("SetNewSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(header, new object[] { header.DesiredSize.Width });
            }
        }
    }

Please give this a try and let me know if this works for you.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.