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

[Solved] Grouping on a DataTable

4 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 25 Oct 2011, 03:27 PM
Hi,

I am using Custom Server Binding to a DataTable containing results from a database query. I am trying to add grouping to the grid on a specific column but doing so gives me an exception:

[ArgumentException: Property with specified name: Row[ID] cannot be found on type: System.Data.DataRowView
Parameter name: propertyName]
   Telerik.Web.Mvc.Infrastructure.Implementation.Expressions.CustomTypeDescriptorExtensions.Property(ICustomTypeDescriptor typeDescriptor, String propertyName) +264
   lambda_method(Closure , DataRowView ) +44...

Code for the grid (where Model.Data is of type System.Data.DataTable):
Html.Telerik().Grid(Model.Data)
            .Name("Grid")
            .DataBinding(dataBinding => dataBinding.Server().Select("CustomServerBinding", "Grid")
            .Groupable(groupign => groupign.Groups(groups => groups.Add(o => o.Row["ID"])))

Query for the Data:
SELECT ID, Value, Credit FROM Report

Is there something that I am missing in my code?

Thank you,
Kevin

4 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 26 Oct 2011, 09:00 AM
Hi Kevin,

Unfortunately, with the current official version of our grid component there is no easy way to set initial group expression when bound to a DataTable. However, we have already addressed this limitation by adding the appropriate overloads (which accepts member name as string instead of as expression)
 to the GridGroupDescriptorFactory. Therefore, please download the latest internal build in which this functionality is available.

All the best,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Kevin
Top achievements
Rank 1
answered on 27 Oct 2011, 06:49 PM
Hi Rosen,

Thank you for your reply. I have downloaded the latest internal build (1014) and it doesn't seem to be in there, is it in another build?

Thanks,
Kevin
0
Accepted
Rosen
Telerik team
answered on 28 Oct 2011, 09:07 AM
Hello Kevin,

Indeed, you are correct, the change in question is not available in the build you are referring to. However, I have attached a newer build which contains the required changes. Also those changes are also present in the Telerik Extensions for ASP.NET AJAX Q3 2011 BETA release.

Regards,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Kevin
Top achievements
Rank 1
answered on 28 Oct 2011, 05:02 PM
Hi Rosen,

The hotfix worked, thanks!

Kevin
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or