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

Filtering data - Error When decimal filter applied.

Hi, Here is the description of the error I am having for filter bar. Steps to reproduce the error : I have data grid wired with filter bar. When i apply custom filter on data grid --> "Contains" condition on Numeric column of data grid--> enter any numeric value --> Messagebox is dispalyed "Cannot perfrom like operation on System.Decimal and System.String" Could you please suggest me how to trap this error? Or give me some solution by which i can avoid applying "Contains" custom condition for numeric columns? Thanks, Pramod Dhanwade

3 Replies

AD Administrator Syncfusion Team August 3, 2004 08:24 AM UTC

You can try catching the error by handling grid.ValidateFailed (I think this should be hit in this case, but I may be wrong.). There you can display your own message. To avoid the grid difpalying its default message, set grid.CurrentCell.ErrorMessage = "" and set e.Handled = true. In 2.0.5.1, you can design your own custom filter dialog and display it instead of the default. That way, you can avoid having a Contains option for numerical columns, or whatever. See the GridFilterBar sample that ships with 2.0.5.1 to see a sample.


PD Pramod Dhanwade August 3, 2004 09:28 AM UTC

Hi, Thanks for your suggestion. I used filterbar_FilterBarTextChanged event. I applied new filter condition to the datagrid DataView. While applying this filter condition, it throws an error, which i caught and thus avoiding the messagebox getting displayed. Thanks once again for your support. Pramod Dhanwade >You can try catching the error by handling grid.ValidateFailed (I think this should be hit in this case, but I may be wrong.). There you can display your own message. To avoid the grid difpalying its default message, set grid.CurrentCell.ErrorMessage = "" and set e.Handled = true. > >In 2.0.5.1, you can design your own custom filter dialog and display it instead of the default. That way, you can avoid having a Contains option for numerical columns, or whatever. See the GridFilterBar sample that ships with 2.0.5.1 to see a sample.


AD Administrator Syncfusion Team January 19, 2006 09:25 AM UTC

>Hi, > >Here is the description of the error I am having for filter bar. > >Steps to reproduce the error : > >I have data grid wired with filter bar. > >When i apply custom filter on data grid --> "Contains" condition on Numeric column of data grid--> enter any numeric value --> Messagebox is dispalyed "Cannot perfrom like operation on System.Decimal and System.String" > >Could you please suggest me how to trap this error? Or give me some solution by which i can avoid applying "Contains" custom condition for numeric columns? > >Thanks, >Pramod Dhanwade

Loader.
Live Chat Icon For mobile
Up arrow icon