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.

GridFilterBar Questions

Thread ID:

Created:

Updated:

Platform:

Replies:

29439 May 25,2005 11:15 AM May 25,2005 11:38 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 25, 2005 11:15 AM

First, is it possible to have a filterbar not filter certain columns? So some columns in the grid will allow filtering while other columns in the same grid will not. Also I noticed that if I start entering a new record in a GDBG then before completing the record I change the filter in a column for which I haven''t entered data in the new row yet. The new row stays in the filtered selection, but if I try to click on the new row again I get an IndexOutOfRangeException. It appears that when going back to the newly created row, the grid is trying to use it''s index before the filter, which is then out of range after the filter is run. I assume this is a bug in the way the GDBG handles filtering, but in any case I need a way to work around it. Thanks

Administrator [Syncfusion]
Replied On May 25, 2005 11:36 AM

1) Handle the FilterBarCreatingColumnHeader event. In the event handler, you can disallow filtering for a column. Searc for "don''t try filter these columns" in the GridFilterBar sample we ship. 2) You can avoid this problem by handling the CurrentCellMoving event and either cancel the changes or save them if you are clicking a filterbar cell.
private void gridDataBoundGrid1_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e)
{
	if(this.gridDataBoundGrid1.Binder.IsAddNew &&
		this.gridDataBoundGrid1.CurrentCell.MoveToRowIndex == 1)
	{
		this.gridDataBoundGrid1.CurrentCell.EndEdit();
		this.gridDataBoundGrid1.Binder.EndEdit();
		// or maybe this.gridDataBoundGrid1.Binder.CancelEdit();
	}
}

Administrator [Syncfusion]
Replied On May 25, 2005 11:38 AM

Thank you for the very quick response.

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.

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.

;