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

Question: Invalid property or field - '[name]' for type: Object

11 Answers 2085 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
Agustin M Rodriguez, MCSD, MCPD asked on 17 Sep 2009, 09:58 PM
Greetings,

I am hopping someone in the community knows what may cause the following exception:

System.ArgumentException: Invalid property or field - '[name]' for type: Object

Currently we are experiancing this exception any time we click on the filter icon on a column and before the filter dialog is displayed or any time we attempt to group by a column.  Filtering and grouping thru API calls works fine.

Version: WPF_2009_Q2_SP1

Target Site:
{Telerik.Windows.Data, Version=2009.2.813.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7}
{System.Linq.Expressions.Expression CreateMemberAccessExpression(Telerik.Windows.Data.Expressions.IMemberAccessToken, System.Linq.Expressions.Expression)}

11 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Sep 2009, 05:46 AM
Hi Agustin M Rodriguez,

Please provide more info about your collection of objects and how the grid is bound in your case. This exception can be raised if the grid will unable to retrieve the type of the item in the collection or you have collection of items with object type.

Best wishes,
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
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
answered on 18 Sep 2009, 07:04 PM
We are currently using CSLA.NET Framework version 3.7.0

The collection is a CSLA collection that inherits from BusinessListBase<T,C>,  The collection items inherit from BusinessBase<T>

I have also experianced the issue described in the following post, however it indicates that the issue was fixed in 3.6.x

http://www.telerik.com/community/forums/wpf/gridview/invalidoperationexception-when-trying-to-filter.aspx

Setting the filter/grouping descriptors in code with the same object work fine.




0
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
answered on 18 Sep 2009, 07:09 PM
Is there a way to force the DataType instead of relaying on automatic detection?
0
Vlad
Telerik team
answered on 23 Sep 2009, 07:09 AM
Hello Agustin,

You can set the columns DataType to desired values.

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
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
answered on 23 Sep 2009, 09:00 PM
Setting the data type property in code does not appear to make a difference.

I am setting it during the AutoGeneratingColumn event.

any other suggestions?
0
Vlad
Telerik team
answered on 24 Sep 2009, 06:15 AM
Hello Agustin,

Can you send us small example which demonstrate these problems? I'll gladly fix them!

Regards,
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
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
answered on 28 Sep 2009, 04:47 PM
Vlad,

Thank you for your support, I need to check with legal before I can send any code that provides enough context to be useful, however I found a temporary work around by setting the ShowDistinctFilters property to false for the column being auto-generated.  This allows the filtering dialog to display with out any issues.

 private void ContentGrid_AutoGeneratingColumn(object sender, telc.GridViewAutoGeneratingColumnEventArgs e) {  
     
    e.Column.ShowDistinctFilters = false;  
      




0
Shannon Marsh
Top achievements
Rank 1
answered on 30 Oct 2009, 02:50 AM
Hi,

We are having a similar probelm when tyring to use the filter.  We have tried the workaround suggested by setting ShowDistinctFilters = false  but we still get a NotSupportedException when just trying to type in a value into the filter.

In this example we have a "ResidentialAddress" Column and we are trying to filter it to show only rows with the test value "LFHHZ".

Message:
The expression ((IIF(([10007] != null), [10007].ResidentialAddress, null) ?? "").ToLower().Contains("lfhhz") = True) is not supported.

Source:
"Microsoft.Data.Services.Client"

We are tyring to bind our RadGridView to the results of a ADO.Net DataServices query so perhaps the query generated by the RadGridView is too complex for DataServices. 

Binding the grid to a property that returns this...

 

DataServiceContext svc = new DataServiceContext(new Uri("http://localhost:1635/MyDataService.svc"));

 

 

return svc.CreateQuery<PartySummary>("PartySummarySet");

 


Has anyone else tried this?   Are we attempting to do the impossible?

Thanks!




0
Vlad
Telerik team
answered on 30 Oct 2009, 07:13 AM
Hello Shannon,

Indeed most probably the grid expression is too complex for the service. Why not use RIA services instead? Please check this demo for more info about how to transfer the grid filtering to the server:
http://demos.telerik.com/silverlight/beta/#GridView/DomainDataSource

Kind regards,
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
mohsen
Top achievements
Rank 1
answered on 05 Aug 2017, 11:43 AM

hi

I have a similar problem

My read action

public ActionResult PersonPhones_Read([DataSourceRequest]DataSourceRequest request)
        {
            IEnumerable  < PersonPhone> personphones = db.PersonPhones.ToList();
            DataSourceResult result = personphones.ToDataSourceResult(request, c => new PersonPhoneVM 
            {
                PhoneNumber = c.PhoneNumber,
                PhoneNumberTypeID = c.PhoneNumberTypeID,
                ModifiedDate = c.ModifiedDate,
                Name = c.Person.FirstName
            });

            return Json(result);
        }

My view:

@(Html.Kendo().Grid<WebApplicationTestTelerik.VIewModel.PersonPhoneVM>()
      .Name("grid")
      .Columns(columns =>
      {
          columns.Bound(c => c.ModifiedDate);
          columns.Bound(c => c.PhoneNumber);
          columns.Bound(c => c.Name);

      })
      .Pageable()
      .Sortable(sortable => {
          sortable.SortMode(GridSortMode.SingleColumn);
      })
      .Scrollable()
      .DataSource(dataSource => dataSource
          .Ajax()
          .Read(read => read.Action("PersonPhones_Read", "phone2"))
      )
)

when click on Name for sorting Error Invalid property or field - '[name]' for type rise.

in model i have personId but in View I have Person Name. (foreign key is business ID)

0
Stefan
Telerik team
answered on 09 Aug 2017, 01:38 PM
Hi Mohsen,

This forum thread is regarding the RadGridView component from the UI for WPF suite. In order to keep the threads consistent, please, post your inquiry in the relevant forum section.

Thanks in advance for your understanding.

Regards,
Stefan X1
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
Shannon Marsh
Top achievements
Rank 1
mohsen
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or