We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

dynamic filter !!!

Thread ID:

Created:

Updated:

Platform:

Replies:

5210 Jun 25,2003 09:33 AM UTC Jun 30,2003 04:26 AM UTC WinForms 2
loading
Tags: GridControl
lobrys
Asked On June 25, 2003 09:33 AM UTC

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

Administrator [Syncfusion]
Replied On 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; } } }

lobrys
Replied On June 30, 2003 04:26 AM UTC

Thanks a lot everything works as I want Lobrys

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;