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

Refresh filter bar grid

Hi !

I use the filter bar on a grid. On the example you can find on "Essential Studio Sample Browser" (Grid sample>Samples>Data Bound>FilterBarGrid), after having filtered any data on a column, if you want to filter another column, there are still data in the filter which have no way to appear: they don't appear anymore in the filtered grid.
Here is a screenshot of the example I spoke. You can see that I have filtered the data on "Blauer See Delicatessen" and there is just one line left in the grid. So there might be only one choice left in the filter bar for the ContactName... and there is still all the fields witch are not listed in the grid !
Do you know how I could refresh these fields each time I filter the grid ?

Thank you !

fieldRefreshIssue0.zip

1 Reply

SA Saravanan A Syncfusion Team March 27, 2007 01:18 AM UTC

Hi Julien,

You can achieve this by handling FilterBarFilterCompleted event and FilterBarTextChanged event. When the new filter condition is selected remove the old filter condition.
Here is the code snippet.

string oldFilterString = "";

void theFilterBar_FilterBarFilterCompleted(object sender, GridFilterBarTextChangedEventArgs e)
{
oldFilterString = this.theFilterBar.RowFilter;
}

void theFilterBar_FilterBarTextChanged(object sender, GridFilterBarTextChangedEventArgs e)
{
if (oldFilterString != "")
{
string newFilterString = this.theFilterBar.RowFilter.Replace(oldFilterString + " and ", "");
this.theFilterBar.ResetFilterRow(gridDataBoundGrid1);
this.theFilterBar.RowFilter = newFilterString;
}
}

Regards,
Saravanan

Loader.
Live Chat Icon For mobile
Up arrow icon