The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hello
here is my question
How to have a dynamic filter?
in another words, how to show (in the combobox filter) ONLY the values of the VISIBLE rows...
thanks a lot
lobrys
ADAdministrator Syncfusion Team June 25, 2003 11:58 AM UTC
You can handle the CurrentCellShowingDropDown event, and swap the drop list out at that point. Here is a rough try at it.
private void gridDataBoundGrid1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(cc.ColIndex > 0 && cc.RowIndex == 1) //filterrow
{
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if(cr != null)
{
StringCollection sc = new StringCollection();
sc.Add("(none)");
for(int i = this.gridDataBoundGrid1.TopRowIndex;
i <= this.gridDataBoundGrid1.ViewLayout.LastVisibleRow; ++i)
{
string s = this.gridDataBoundGrid1[i, cc.ColIndex].FormattedText;
if(sc.IndexOf(s) == -1)
sc.Add(s);
}
cr.ListBoxPart.DataSource = sc;
}
}
}