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.

Error while applying filter

Thread ID:

Created:

Updated:

Platform:

Replies:

19765 Oct 4,2004 07:09 AM Oct 5,2004 03:38 AM Windows Forms 7
loading
Tags: GridControl
Kanika Aggarwal
Asked On October 4, 2004 07:09 AM

Hi I have a grid consists of Filterbar.I have written a code in "fbFilter_FilterBarTextChanged" to store the applied filter and used Datagrid Default view to apply filter. Now 1. Apply filter on a column. 2.Change the value in the column ,on which filter is applied, and click on any other cell. 3.The changes done are lost and an error is thrown,which i am not able to catch, and application shuts down. However if i am changing the value of any other column on filtered grid then no error is thrown and application works fine. Also application works fine if no filter is applied on grid. Can you help me for this.

Administrator [Syncfusion]
Replied On October 4, 2004 07:32 AM

Are you using version 2.1.0.9? There was a problem like this in an earlier version if you did not actually used a DataTable as your datasource (ie., maybe you use datasource=DataSet + datamember=tablename to specifiy the data source for the grid). You normally do not have to set the filter on the defaultview as the FilterBar should do this for you. What are trying to do this in the FilterBarTextChanged event?

Administrator [Syncfusion]
Replied On October 4, 2004 08:10 AM

Thanks for the reply. I am using version 1.6.Also i anot using datasource=DataSet + datamember=tablename In the event i am forming the filter string and applying it. Also i am attaching the Error message box bitmap file and the code which i have written in the Event. >Are you using version 2.1.0.9? There was a problem like this in an earlier version if you did not actually used a DataTable as your datasource (ie., maybe you use datasource=DataSet + datamember=tablename to specifiy the data source for the grid). > >You normally do not have to set the filter on the defaultview as the FilterBar should do this for you. What are trying to do this in the FilterBarTextChanged event? FilterGridError_5824.zip

Administrator [Syncfusion]
Replied On October 4, 2004 08:49 AM

The filterbar.FilterBarTextChanged event is strictly a noticification event. It does not give you the option of changing the filter that would be applied. Is this what you are trying to do? (If you upgrade to the 2.0 code base, there is more flexibility in how you can handle the filter string, including droping your own custom dialog if that is what you want to do.) It looks like you are trying to handle an existing filter that is not part of the FilterBar filtering? Is this case? This is not supported in the 1.6 grid. The 2.0 code base manages this. If you do not want to upgrade and own the 2.0 source code version, you can just include the code from from the 2.0 GridFilterBar class in your project to get this support. Is this why are you trying to handle the FilterBarTextChanged event?

Kanika
Replied On October 5, 2004 01:20 AM

Thanks for your suggestion. But what i am trying to do is: Application stores the fiterbar applied on the grid.When the user runs the application again then the filter applied during last seesion will be fetched and is applied on the grid.So I am applying this filter on grid in filterbar.FilterBarTextChanged event As suggested by you. I have moved the code in the filterbar.FilterApplied event.But the problem still presists. Can you suggest any appropriate approach for this. Also from where i can get the 2.0 version code. Thanks kanika >The filterbar.FilterBarTextChanged event is strictly a noticification event. It does not give you the option of changing the filter that would be applied. Is this what you are trying to do? (If you upgrade to the 2.0 code base, there is more flexibility in how you can handle the filter string, including droping your own custom dialog if that is what you want to do.) > >It looks like you are trying to handle an existing filter that is not part of the FilterBar filtering? Is this case? This is not supported in the 1.6 grid. The 2.0 code base manages this. If you do not want to upgrade and own the 2.0 source code version, you can just include the code from from the 2.0 GridFilterBar class in your project to get this support. > >Is this why are you trying to handle the FilterBarTextChanged event?

Administrator [Syncfusion]
Replied On October 5, 2004 02:05 AM

If you want to explicitly set the filter to something, then try just setting the RowFilter property. This should trigger the filter process. So, after you have wired the filterBar, try code like: string savedFilter = "[CustomerID] LIKE ''A*''"; this.theFilterBar.RowFilter = savedFilter;

Administrator [Syncfusion]
Replied On October 5, 2004 03:22 AM

Thanks .. I am following the same approach. But to save the filter string in the database, i am storing the filter applied in a variable in filter changed event. Also even if i remove this event the same error is coming. If it is only because of the version i am using then what can be the possible solution. Thanks >If you want to explicitly set the filter to something, then try just setting the RowFilter property. This should trigger the filter process. > >So, after you have wired the filterBar, try code like: > >string savedFilter = "[CustomerID] LIKE ''A*''"; >this.theFilterBar.RowFilter = savedFilter; >

Administrator [Syncfusion]
Replied On October 5, 2004 03:38 AM

Adding the 2 lines of code shown above in the FilterBarGrid sample shows the initial grid filtered as expected. If you try these lines in the FilterBarGrid sample, do things work for in that sample? If not, then maybe getting the latest relase will solve your problem. You can download the latest release for which you are licensed from your Direct Trac support home page. If it does work, then there may be something particular about what you are doing that is affecting this. If you can post a sample project showing the problem, I can try it with the latest code to see if it runs with the lastest code. If it does not, I can try to debug it to see what might be causing this problem.

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.

;