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
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.
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.
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.
I am setting it during the AutoGeneratingColumn event.
any other suggestions?
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.
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; |
} |
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!
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.
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)
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