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;
}
}