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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Filter feature

Thread ID:

Created:

Updated:

Platform:

Replies:

16739 Jul 22,2004 06:34 PM UTC Jul 22,2004 07:42 PM UTC WinForms 1
loading
Tags: GridControl
Tony John
Asked On July 22, 2004 06:34 PM UTC

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 07:42 PM UTC

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

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

;