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

FilterExpressions with no records

3 Answers 50 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 01 Jun 2010, 07:05 PM
I have RadViewList bound to an ObjectDataSource. If the data source returns no records, filter expressions fail to apply (instead of showing "No data" (EmptyDataTemplate)).

Is this a bug? If not, this is annoying because when I call Rebind() I have to clear all filters, rebind, check (items.count > 0), and the reapply filters.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 02 Jun 2010, 09:56 AM
Hello Jorge,

I'm afraid that I am unable to observe such behavior, neither using RadFilter nor directly using RadListView filtering API. Please check the attached sample, maybe I'm missing something obvious.

Kind regards,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jorge
Top achievements
Rank 1
answered on 02 Jun 2010, 12:48 PM
The ObjectDataSource is connected to a Dataset as it is retrieving SQL data. I filter with the following code
            lvRegistros.FilterExpressions.BuildExpression().EqualTo("estado_actual", 1).Build(); 

where "estado_actual" is a database field (This field must be listed in the DataKeyNames).
If no records are retrieved, I get

Invalid property or field - 'estado_actual' for type: Object 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.ArgumentException: Invalid property or field - 'estado_actual' for type: Object 
 
Source Error: 
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace: 
 
[ArgumentException: Invalid property or field - 'estado_actual' for type: Object] 
   Telerik.Web.Data.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance) +167 
   Telerik.Web.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName) +122 
   Telerik.Web.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull) +42 
   Telerik.Web.Data.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpressionOverride() +83 
   Telerik.Web.Data.Expressions.MemberAccessExpressionBuilderBase.CreateMemberAccessExpression() +80 
   Telerik.Web.Data.Expressions.FilterDescriptorExpressionBuilder.CreateMemberExpression() +228 
   Telerik.Web.Data.Expressions.FilterDescriptorExpressionBuilder.CreateBodyExpression() +61 
 

Thanks!
0
Accepted
Rosen
Telerik team
answered on 03 Jun 2010, 12:40 PM
Hello Jorge,

Indeed I was able to recreate the error you are getting. However I'm happy to inform you that it was addressed and the fix will be included with the next internal build (available for download next Tuesday). Meanwhile I have updated your telerik point for bringing this to our attention.

Sincerely yours,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ListView
Asked by
Jorge
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Jorge
Top achievements
Rank 1
Share this question
or