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.

Filter feature

Thread ID:





16739 Jul 22,2004 02:34 PM Jul 22,2004 03:42 PM Windows Forms 1
Tags: GridControl
Tony John
Asked On July 22, 2004 02:34 PM

hi, I need to implement the Filter feature in a grid. We are trying to use the regular grid instead of the GridDataBoundGrid. have few issues. 1. Is is possibel to use the GridFilterBar for the ''GridControl'' ? 2. is it possible to manually add items in the filter combo? By default, it loads all items in the column. 3. If FilterBar is supported only by the ''GridDataBoundGrid'', is it possible to use the GridDataBoundGrid, but manually populate the data instead of using the DataSource ? Thanks for any help. - ToJo

Administrator [Syncfusion]
Replied On July 22, 2004 03:42 PM

1 & 3 - The GridFilterBar is only supported for the GridDataBoundGrid using a DataTable as its DataSource. The reason for this is that the filtering is actually done using a DataView.RowFilter property. 2) For any combobox cell (including a combobox in the filter cell), you can dynamically adjust the droplist by handling CurrentCellShowingDropDown.
//assume dataTable1 is the full datatable that is the datasource for the combobox column....
private void gridDataBoundGrid1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
	GridCurrentCell cc = this.gridDataBoundGrid.CurrentCell;
	if(cc.ColIndex == 2)
  //column that need to be filtered...
		GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
		if(cr != null)
			DataView dv = new DataView(dataTable1);
			dv.RowFilter = string.Format("[MyCol1] = ''{0}''", this.gridDataBoundGrid1[cc.RowIndex, 1].Text);

	((GridComboBoxListBoxPart)cr.ListBoxPart).DataSource = dv;


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.

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.