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

GridDataBoundGrid & GridFilterBar - refresh

Thread ID:





14382 May 26,2004 06:04 AM UTC May 26,2004 06:36 AM UTC WinForms 1
Tags: GridControl
Asked On May 26, 2004 06:04 AM UTC

Hi, I''m associating a GridFilterBar on a GridDataBoundGrid control. In one column of the GridDataBoundGrid, i have some numeric values. I need to calculate the sum of this column based on the filter criteria. I have used the GridFilterBar_TextChangedEvent. It always shows the sum of the columns of the grid before the filter is applied. Ex: Grid Columns: Filter condition = null Cash 10 30 40 50 60 100 110 Initially Sum:400 Say a filter is applied like Cash >= 100 The column is now: Cash 100 110 The sum : 400 Say a filter is applied Cash > 100 The column is now: Cash 110 But the sum : 210 which is the previous columns based on the filter criteria Cash >= 100. I want to do the total after the criteria is applied, after the values are displayed in the grid. On which event do i perfom such a total. Request you to help at the earliest.

Administrator [Syncfusion]
Replied On May 26, 2004 06:36 AM UTC

Try catching the ListChanged event on the underlying DataView and look for ListChangedType.Reset. CurrencyManager cm = (CurrencyManager)this.gridDataBoundGrid1.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember]; DataView dv = (DataView) cm.List; dv.ListChanged += new ListChangedEventHandler(dv_ListChanged); The handler.
private void dv_ListChanged(object sender, ListChangedEventArgs e)
	if(e.ListChangedType == ListChangedType.Reset)
		//do your sum


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