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

InvalidOperationException when mixing AllowFilteringByColumn="true" and ControlParameters

3 Answers 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 23 Nov 2011, 05:13 PM
Hi,

I have two RadGrids bound to two different EntityDataSources.  The 2nd datasource uses WhereParameters and ControlParameters to pass the SelectedValue of the first grid to the datasource of the 2nd grid.  This all works fine, until I enable filtering on the 2nd radgrid.  As soon as I set

 

AllowFilteringByColumn="true"

 

on the MasterTableView of the 2nd grid, I get the following exception:

WhereParameters cannot be specified unless AutoGenerateWhere==true or Where is specified. 
  
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.InvalidOperationException: WhereParameters cannot be specified unless AutoGenerateWhere==true or Where is specified.
  
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: 
  
  
[InvalidOperationException: WhereParameters cannot be specified unless AutoGenerateWhere==true or Where is specified.]
   System.Web.UI.WebControls.EntityDataSource.ValidateUpdatableConditions() +93743
   System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +166
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.GridTableView.DataBind() +363
   Telerik.Web.UI.RadGrid.DataBind() +173
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
  
  

Is this a bug or something I am doing incorrectly?

Thanks,

Craig

3 Answers, 1 is accepted

Sort by
0
Teoman
Top achievements
Rank 1
answered on 12 Feb 2012, 09:45 PM
anybody have solution for this?also i have the same problem.
0
Tsvetina
Telerik team
answered on 15 Feb 2012, 10:13 AM
Hi Teoman,

You did not share your EntityDataSource declaration but can you confirm that you have configured it, so that is supports filtering?
Filtering Data (EntityDataSource)

Also, is your case identical with the other one - two related grids and filtering on the second? If so, can you confirm whether the problem is reproduced when the second grid is isolated on a page, without the first one?

Greetings,
Tsvetina
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Teoman
Top achievements
Rank 1
answered on 20 Feb 2012, 12:38 PM
i did it with custom query..i cant find solution related with ef..now its working..
Tags
Grid
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
Teoman
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or