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.

How to fire an event after filtering GDBG?

Thread ID:

Created:

Updated:

Platform:

Replies:

25116 Feb 17,2005 11:47 PM Feb 20,2005 07:35 AM Windows Forms 3
loading
Tags: GridControl
Frank Lin
Asked On February 17, 2005 11:47 PM

I added a gridFilterBar to a GDBG. Now I want to show a message of currentcell after filtering. Which event should I fire? The filterbar.FilterBarTextChanged event is fired before the GDBG is filtered.

Administrator [Syncfusion]
Replied On February 18, 2005 05:03 AM

Right now there is no event raised after the filter. We will add one. For the time being, to catch this action, you would need to derive GridDataBoundGrid and override OnCurrentCellClosedDropDown. In the override, call the base class, and then you could do your ''after filter'' work as the filtering is completed by this time. Or, you could raise an event at this point so any listener to the event could act on your custom "AfterFilter" event. Here is a derived class:
 public class MyGridDataBoundGrid : GridDataBoundGrid
 {
	protected override void OnCurrentCellCloseDropDown(Syncfusion.Windows.Forms.PopupClosedEventArgs e)
	{
		base.OnCurrentCellCloseDropDown(e);
		if(this.CurrentCell.RowIndex == 1) //filter row
		{
			Console.WriteLine("After filter, there are {0} rows in grid.", this.Model.RowCount);
		}
	}
 }

Frank Lin
Replied On February 20, 2005 02:28 AM

Hi,Clay Thanks for your answer. Actually, the GDBG OnCurrentCellCloseDropDown event isn''t overridable. There is an error to override Protected Overrides Sub oncurrentcellclosedropdown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.PopupClosedEventArgs). Is there any other solutions? Actually, it''s absolutely necessary in my applicaton to fire an event and calculate remaining records after filter.

Administrator [Syncfusion]
Replied On February 20, 2005 07:35 AM

That method is overridable. Here is a class that I added to the FilterBarSample and it worked as expected for me. Imports Syncfusion.Windows.Forms.Grid Public Class MyGridDataBoundGrid Inherits GridDataBoundGrid Protected Overrides Sub OnCurrentCellCloseDropDown(ByVal e As Syncfusion.Windows.Forms.PopupClosedEventArgs) MyBase.OnCurrentCellCloseDropDown(e) If Me.CurrentCell.RowIndex = 1 Then '' filter row Console.WriteLine("After filter, there are {0} rows in grid.", Me.Model.RowCount) End If End Sub End Class If you do not want to do this, you can wait until the next release (I do not know when it will be available, but it is in the works). We have added an event, FilterBarFilterCompleted, that is raised after the filter has been completed.

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.

;