Completed
Last Updated: 10 Jun 2022 08:46 by ADMIN
Release R2 2022 SP1
Fernando
Created on: 08 Jan 2022 18:12
Category: UI for WinForms
Type: Bug Report
2
RadFilterView: Vertical Scroll Bar's range is not properly updating every time at run time after collapse/expand

HI,

 

Exploring the Demo Winforms FilterView component a bug is present.

When you expand several categories ,the automatic Vertical Scroll bar is showed but the "Maximum"  property value is wrong.

You can't see all the items inside. Some items are hidden at bottom.

But if you collapse some category the new "Maximum" values takes the right previous value before collapsing showing more space as expected

I have a workaround to prevent this situation calling CategoryExpandedChanged event.

Firstly I need to call Application.DoEvents() in order to resizing internally by the component all the StackLayoutPanels connaining the Category Items 

After that, I call the private method UpdateScrollBars (Suggested by support) and the ScrollBar takes the right size for its content.

Now I can show all the contained items inside the FilterView panel.

 

FRC

 
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
            DataTable dt = new DataTable();
            for (int i = 0; i < 20; i++)
            {
                dt.Columns.Add("col" + i, typeof(string));
            }
            for (int i = 0; i < 10; i++)
            {
                DataRow r = dt.NewRow();
                foreach (DataColumn col in dt.Columns)
                {
                    r[col.ColumnName] = Guid.NewGuid().ToString();
                }
                dt.Rows.Add(r);
            }
            this.radFilterView1.DataSource = dt;
          
        }


        private void radFilterView1_CategoryCreated(object sender, Telerik.WinControls.UI.FilterView.FilterViewCategoryCreatedEventArgs e)
        {
            e.Category.ExpandedChanged += Category_ExpandedChanged;
            e.Category.Expanded = false;

        }

        private void Category_ExpandedChanged(object? sender, EventArgs e)
        {
            // You need pass the control to Windows main loop to perform the pending telerik events after property Expanded change in order to resize internally
            // the StackLayoutPanel Containers before calling UpdateScrollBars
            Application.DoEvents();
            // Now your code
            MethodInfo mi = typeof(RadFilterViewElement).GetMethod("UpdateScrollbars", BindingFlags.Instance | BindingFlags.NonPublic);
            mi.Invoke(this.radFilterView1.FilterViewElement, new object[] { this.radFilterView1.FilterViewElement.ElementsPanel.Size });
            // Hide the horizontal scrolll bar
            radFilterView1.FilterViewElement.HorizontalScrollBar.Visibility =ElementVisibility.Collapsed;
        }

    }

1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 10 Jan 2022 06:56

Hi, Fernando,

I confirm that this is an issue with RadFilterView. I have also updated your Telerik points.

Currently, feel free to use the temporary solution you have. We will do our best to introduce a fix accordingly. Make sure that you cast your vote for the item in order to increase it priority. Please excuse us for the inconvenience caused.

Regards,
Dess | Tech Support Engineer, Principal
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/.

Attached Files: