From cabb8cc76efec816127f1f49f0e7b53f05605f4b Mon Sep 17 00:00:00 2001 From: KB Bot Date: Fri, 12 Dec 2025 09:09:13 +0000 Subject: [PATCH] Added new kb article grid-autoexpand-filter-section-column-menu --- ...d-autoexpand-filter-section-column-menu.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 knowledge-base/grid-autoexpand-filter-section-column-menu.md diff --git a/knowledge-base/grid-autoexpand-filter-section-column-menu.md b/knowledge-base/grid-autoexpand-filter-section-column-menu.md new file mode 100644 index 000000000..e0151dd60 --- /dev/null +++ b/knowledge-base/grid-autoexpand-filter-section-column-menu.md @@ -0,0 +1,101 @@ +--- +title: Automatically Expand Filter Section in Grid Column Menu +description: Learn how to auto-expand the filter section when opening the column menu in TelerikGrid. +type: how-to +page_title: Automatically Expand Filter Section in Grid Column Menu +meta_title: Autoexpand Filter Section in Grid Column Menu +slug: grid-kb-autoexpand-filter-section-column-menu +tags: grid, column-menu, filter +res_type: kb +ticketid: 1705448 +--- + +## Environment + + + + + + + + +
ProductGrid for Blazor
+ +## Description + +I want the filter section of the [column menu](slug:grid-column-menu) in the [TelerikGrid](slug:grid-overview) to automatically open when a user opens the column menu. + +## Solution + +To auto-expand the filter section, use JavaScript interop to simulate a click on the filter header when the column menu is opened. Below is a runnable example: + +````Razor +@inject IJSRuntime JSRuntime + + + + + + + + + + + + +@code { + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + await Task.Delay(500); // Ensure the grid is fully rendered + await JSRuntime.InvokeVoidAsync("initColumnMenuAutoClick"); + } + } + + private IEnumerable GridData = Enumerable.Range(1, 30).Select(x => new SampleData + { + Id = x, + Name = "name " + x, + Team = "team " + x % 5, + HireDate = DateTime.Now.AddDays(-x).Date + }); + + public class SampleData + { + public int Id { get; set; } + public string Name { get; set; } + public string Team { get; set; } + public DateTime HireDate { get; set; } + } +} +```` + +## See Also + +* [Grid Documentation](slug:grid-overview) +* [Column Menu Documentation](slug:grid-column-menu)