This is a migrated thread and some comments may be shown as answers.

Filtering an Int data type throws exception

2 Answers 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sanket Singhvi
Top achievements
Rank 1
Sanket Singhvi asked on 22 Jul 2011, 05:07 PM
Hi, 

We have implemented searching mechanism for RadGridView. It works fine when all the columns in Grid are of String type. 
But in one of the grid I have Int columns.

I figured out the problem. Currently my FilterOperator is "FilterOperator.Contains" and then it throws error "The method or operation is not implemented." for int column. If I changed FilterOperator to IsEqualTo it works great. But why can't I have FilterOperator.Contains for Int as well? I wish if it could do that.

Regards
Sanket

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 24 Jul 2011, 06:16 PM
Hi Sanket Singhvi,

The Contains filter operator will call the Contains method of the string class. There is no Contains method defined for the Int32 class, so you can't have Contains when you are filtering on Int32. Besides, what does Contains mean when you have numbers -- this is a string operation, not numerical.

Regards,
Ross
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
christine
Top achievements
Rank 1
answered on 28 Sep 2011, 05:06 PM
disregard previous post.
Tags
GridView
Asked by
Sanket Singhvi
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
christine
Top achievements
Rank 1
Share this question
or