dynamic filter !!!

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

2 Replies

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


LO lobrys June 30, 2003 04:26 AM UTC

Thanks a lot everything works as I want Lobrys

Loader.
Up arrow icon