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

Dynamic Binding Filtering Issue

2 Answers 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Liyo
Top achievements
Rank 1
Liyo asked on 17 Sep 2013, 10:14 AM
I have i have bind my grid to a dynamic object. I am getting following error file i try to filter the grid.


Message: System.InvalidOperationException: The result of the dynamic binding produced by the object with type 'Demo.MyDataRow' for the binder 'Telerik.Windows.Data.SimpleGetIndexBinder' needs at least one restriction.
   at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel)
   at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at lambda_method(Closure , MyDataRow )
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.<DistinctIterator>d__81`1.MoveNext()
   at System.Linq.Enumerable.<TakeIterator>d__3a`1.MoveNext()
   at Telerik.Windows.Controls.GridView.DistinctValueViewModelCollection.AddRangeFromSource(IEnumerable source)
   at Telerik.Windows.Controls.GridView.DistinctValueViewModelCollection.SetSource(IEnumerable source)
   at Telerik.Windows.Controls.GridView.FilteringViewModel.RefreshDistinctValues()
   at Telerik.Windows.Controls.GridView.FilteringViewModel.Refresh()
   at Telerik.Windows.Controls.GridView.FilteringControl.Prepare(GridViewColumn columnToPrepare)
   at Telerik.Windows.Controls.GridView.FilteringDropDown.PrepareFilteringControl()
   at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownPopupOpened(Object sender, EventArgs e)
   at Telerik.Windows.Controls.AutoClosePopupWrapper.OnPopupOpened(Object sender, EventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)     



Can anyone please help me on this.

i have attached my solution at following path.
http://sdrv.ms/1ekZ5D0


Regards,
Liyo Jose.

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 17 Sep 2013, 01:43 PM
Hi,

Please, try to correctly override and implement the TryGetIndex and TrySetIndex methods (just as you have done with TryGetMember and TrySetMember) on your dynamic object since you are accessing the Cells through its indexer. Maybe this will help.

Regards,
Rossen Hristov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
asif
Top achievements
Rank 1
answered on 06 Feb 2017, 12:09 PM

Hi,

Anyone can please suggest me what  I am missing. I have Bound the grid with  "IEnumerable<dynamic>" its working fine.

When I apply Filter, just enable filtering in grid i am getting error anyone can please help me.

 

Thanks,

Tags
General Discussions
Asked by
Liyo
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
asif
Top achievements
Rank 1
Share this question
or