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
close icon

Filtering question

I have a question regarding the sample in the Essential Grid Knowledgebase 10.7. Does this sample work with a non strongly typed dataset? In my sample project I am using a non strongly typed dataset and I am receiving errors when the datatype for the column is anything but a string. Basically the line '_dataTable.DefaultView.RowFilter = filter;' fails when doing a LIKE filter with any datatype other than a string. But of course the sample works fine with all datatypes. Cheers, JF

6 Replies

JF Jim Frapper November 14, 2003 12:10 AM UTC

I have confirmed that the sample works with typed datasets and not with non-typed datasets. Cheers, JF


JF Jim Frapper November 15, 2003 04:26 PM UTC

Essential Grid Knowledgebase 10.7 revisited. My previous post was incorrect. The sample does not use typed datasets. I am confused why I get datatype issues with my datasets vs. the ones constructed from the xml file in the sample. Here is a sample error message I am getting on an integer column "Cannot perform 'Like' operation on System.Int32 and System.String. This message makes sense because you cant do like clauses on integer columns. So basically I have no idea how your sample is working. JF JF


JF Jim Frapper November 15, 2003 06:01 PM UTC

@#!$#@#! All of the columns in the samples dataset have a datatype of string. That is how the sample works. JF


AD Administrator Syncfusion Team November 15, 2003 08:31 PM UTC

As you tracked down, that sample relies on the operator Like which is only valid for strings. I don't know of a simple way to write a 'StartsWith' numerical comparison using the tools supported by DataView.RowFilter calculations.


MK Markus Kraft November 20, 2003 04:27 AM UTC

Hi, why is it to work with the Operant "Like" in INT-columns possibly? Wouldn't this choice have to be prevented? How can I influence the indication of the Operants? greetings markus


AD Administrator Syncfusion Team November 20, 2003 06:25 AM UTC

Right now, there is not a simple way to do this. You would have to derive GridFilterbar, override GetFilterFromRow, and if the currentcell.Renderer.ControlText is (custom), display and handle you own dialog. This would take a little work. You could look at our source code to see how you might go about this. It would require defining your own dialog (maybe copying ours, and directly changing the code there in your copy). I have added a feature request to add code to make doing this easier and to check for proper operands in our list.

Loader.
Live Chat Icon For mobile
Up arrow icon