Completed
Last Updated: 17 Feb 2021 13:14 by ADMIN
Release R1 2021 SP2
Sven
Created on: 16 Feb 2021 11:45
Category: TabbedForm
Type: Bug Report
0
RadTabbedForm: Setting the SelectedTab at runtime doesn't scroll to ensure that the tab is visible

Please refer to the attached project. Pressing A key selects the first tab, B key selected the second tab, etc. The SelectedTab is changed successfully. The content area is refreshed. However, the tab is not visible. The attached gif file illustrates the behavior.

Workaround:

        private void RadTabbedForm1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.A)
            {
                this.radTabbedFormControl1.SelectedTab = radTabbedFormControlTab1;
            }

            if (e.KeyData == Keys.B)
            {
                this.radTabbedFormControl1.SelectedTab = radTabbedFormControlTab2;
            }

            if (e.KeyData == Keys.C)
            {
                this.radTabbedFormControl1.SelectedTab = radTabbedFormControlTab3;
            }


            if (e.KeyData == Keys.D)
            {
                this.radTabbedFormControl1.SelectedTab = radTabbedFormControlTab4;
            }

            //Workaround
            Size s = this.Size;
            this.Opacity = 0;
            this.WindowState = FormWindowState.Maximized;
            this.WindowState = FormWindowState.Normal;

            this.Size = s;
            this.Opacity = 1;
        }

1 comment
ADMIN
Hristo
Posted on: 16 Feb 2021 13:48

Hello,

We are currently working on the item and we will try to include a fix with our next SP release scheduled for next week. Another possible workaround is to update the layout this way: 

private void RadTabbedForm1_KeyDown(object sender, KeyEventArgs e)
{
    //...

    typeof(RadTabbedFormControlTabsElement).GetMethod("UpdateVisibleTabItems", BindingFlags.Instance | BindingFlags.NonPublic).
                                            Invoke(this.TabbedFormControl.TabbedFormControlTabsElement,
                                                                        new object[]
                                                                        {
                                                                            this.TabbedFormControl.TabbedFormControlElement,
                                                                            this.TabbedFormControl.SelectedTab.Item
                                                                        });

    this.TabbedFormControl.TabbedFormControlTabsElement.InvalidateMeasure();
}

Regards,


Hristo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.