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

Issue with RiaDomainService_LoadedData

6 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paresh Sen
Top achievements
Rank 1
Paresh Sen asked on 11 Jan 2010, 07:05 PM

Hi,

I'm using RadGridView with RiaDomainService for data binding.

On the LoadedData method getting the below error.

Any pointers will be of great help.

   

Message: System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. ---> System.InvalidOperationException: No method 'Count' on type 'System.Linq.Queryable' is compatible with the supplied arguments.

   at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)

   at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)

   at Telerik.Windows.Data.QueryableExtensions.Count(IQueryable source)

   at Telerik.Windows.Data.QueryableCollectionView.UpdateTotalItemCount()

   at Telerik.Windows.Data.QueryableCollectionView.UpdateTotalItemCount(NotifyCollectionChangedEventArgs args)

   at Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)

   at Telerik.Windows.Data.QueryableCollectionView.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)

   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)

   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)

   at System.Windows.Controls.Ria.DomainDataSourceView.OnCollectionChanged(NotifyCollectionChangedEventArgs e)

   at System.Windows.Controls.Ria.DomainDataSourceView.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)

   at System.Windows.Data.EntityCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)

   at System.Windows.Data.EntityCollectionView.RefreshView()

   at System.Windows.Data.EntityCollectionView.RefreshOrDefer()

   at System.Windows.Data.EntityCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)

   at System.Windows.Data.EntityCollectionView.<.ctor>b__0(Object sender, NotifyCollectionChangedEventArgs args)

   at System.Windows.Controls.PagedEntityCollection.RaiseCollectionChanged(NotifyCollectionChangedAction action, Entity entity, Int32 index)

   at System.Windows.Controls.PagedEntityCollection.CompleteLoad()

   at System.Windows.Controls.DomainDataSource.ProcessLoadedEntities(LoadContext loadContext, IEnumerable`1 entities)

   at System.Windows.Controls.DomainDataSource.DomainContext_Loaded(LoadedDataEventArgs e, LoadContext loadContext)

   --- End of inner exception stack trace ---

   at System.Windows.Ria.OperationBase.InvokeCompleteAction()

   at System.Windows.Ria.OperationBase.Complete(Object result)

   at System.Windows.Ria.LoadOperation.Complete(DomainClientResult result)

   at System.Windows.Ria.DomainContext.CompleteLoad(IAsyncResult asyncResult)

   at System.Windows.Ria.DomainContext.<>c__DisplayClass17.<Load>b__13(Object )    



Thanks,
Paresh

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Jan 2010, 07:08 AM
Hello Paresh,

Can you post more info how exactly the grid is bound?

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Paresh Sen
Top achievements
Rank 1
answered on 12 Jan 2010, 08:56 AM

Hi Vlad,

 Find the details:

<telerik:RadGridView x:Name="radGridViewAssociatedUsers"   
                              ColumnsWidthMode="Fill" 
                              RowIndicatorVisibility="Collapsed"
                              HorizontalAlignment="Stretch" RowDetailsVisibilityMode="VisibleWhenSelected"
                              IsReadOnly="True" AutoGenerateColumns="False"
                              RowDetailsVisibilityChanged="radGridViewAssociatedUsers_RowDetailsVisibilityChanged"
                              ItemsSource="{Binding Data, ElementName=riaDsAssocaitedUsers}" IsFilteringAllowed="True"
                              Filtering="UsersSearchGrid_Filtering"
                              CanUserReorderColumns="False"
                              FontFamily="Segoe UI" FontSize="13.333"  
                              BorderThickness="2"
                              BorderBrush="#FF506266"                                                       
                              Background="White"
                              Foreground="#FF506266"
                              UseAlternateRowStyle="True"                             
                              GroupPanelForeground="White"                             
                              GroupPanelBackground="#FF92A68A"                             
                              AlternateExpandableRowStyle="{StaticResource GridViewAlternateExpandableRowStyle}"
                              AlternateRowStyle="{StaticResource GridViewAlternateRowStyle}"
                              ExpandableRowStyle="{StaticResource GridViewExpandableRowStyle}"
                              GroupPanelItemStyle="{StaticResource GridViewGroupPanelItemStyle}"                          
                              GroupRowStyle="{StaticResource GridViewGroupRowStyle}"
                              HeaderRowStyle="{StaticResource GridViewHeaderRowStyle}"
                              RowDetailsStyle="{StaticResource GridViewRowDetailStyle}"
                              RowStyle="{StaticResource GridViewRowStyle}"
                              ShowColumnHeaders="True"
                              ShowGroupFooters="True"
                              ShowGroupPanel="True">

 

<riaControls:DomainDataSource x:Name="riaDsAssocaitedUsers" 
                                AutoLoad="True" 
                                LoadSize="40" 
                                Margin="-1,0,1,0" 
                                LoadingData="riaDsAssocaitedUsers_LoadingData"  
                                LoadedData="riaDsAssocaitedUsers_LoadedData">

                            <riaControls:DomainDataSource.DomainContext>
                                <ds:DomainContext/>
                            </riaControls:DomainDataSource.DomainContext>
 
                           <riaControls:DomainDataSource.FilterDescriptors>
                                <riaData:FilterDescriptorCollection LogicalOperator="Or" />
                            </riaControls:DomainDataSource.FilterDescriptors>
 </riaControls:DomainDataSource>

private void riaDsAssocaitedUsers_LoadedData(object sender, LoadedDataEventArgs e)
        {
                //Here e throws TargetInvokationException for operations
                //
e.Entities.ToList().Count and similar operations

 

 

        }

Thanks,
Paresh

0
Stefan Dobrev
Telerik team
answered on 15 Jan 2010, 11:47 AM
Hello Paresh,

Probably there is some kind of problem with your connection to the web server or the SQL server. You can check the e.Error property for more information.

Kind regards,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
simone Px
Top achievements
Rank 1
answered on 28 Jan 2010, 04:26 PM
hi Paresh,

I've got the same problem...

do you solved it?

thanks

Simone
0
simone Px
Top achievements
Rank 1
answered on 02 Feb 2010, 04:17 PM
I got it
0
Steve
Top achievements
Rank 1
answered on 26 Feb 2010, 09:53 PM
Well Simone, what did you get?
Tags
GridView
Asked by
Paresh Sen
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Paresh Sen
Top achievements
Rank 1
Stefan Dobrev
Telerik team
simone Px
Top achievements
Rank 1
Steve
Top achievements
Rank 1
Share this question
or