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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to fire an event after filtering GDBG?

Thread ID:





25116 Feb 18,2005 04:47 AM UTC Feb 20,2005 12:35 PM UTC WinForms 3
Tags: GridControl
Frank Lin
Asked On February 18, 2005 04:47 AM UTC

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 10:03 AM UTC

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)
		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 07:28 AM UTC

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 12:35 PM UTC

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon