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

[Solved] Grouping by field from base class

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefan Karlik
Top achievements
Rank 1
Stefan Karlik asked on 24 Feb 2010, 03:12 PM
Hi,

we have the following structure of class definition for the datasource:

  public interface IActivityInstanceBase : IDataLayerBase
    {
        string Id { get; set; }
        DateTime ExecutionDate { get; set; }
        DateTime PlannedDate { get; set; }
.....
        string ActivityInstanceName { get; set; }
        string ParentId { get; set; } 
    }

    public interface IActivityInstance : IActivityInstanceBase, IExportable, IFileAddable
    {
        IMaintenanceGroup MaintenanceGroup { get; set; }
        IActivity Activity { get; set; }
        IActivityStatus Status { get; set; }
.....
        string MaintenanceGroupName { get; set; }
        string ParentGroupName { get; set; }
    }

Datasource is of type IActivityInstance which inherits IActivityInstanceBase (connected over needdatasource event)

I have to group by a field from the base class (ParentId) which is not possible (Exception field not found in datasource).

In the definition of grid columns i can also use fields from the base class, only in the group by expression it isn“t possible.

Any ideas how to solve that?

regards,
Stefan

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 26 Feb 2010, 01:30 PM
Hi Stefan,

Testing the scenario you have specified, I cannot reproduce what you are getting. Particularly and exception is thrown for the opposite scenario, e.g. when you are trying to group by child properties and you have objects  of the base type in your collection. I cannot reproduce your scenario when you have base properties throwing the exception. Attaching a sample project you can test locally. Let me know if you are able to reproduce what you are getting in it.

Best wishes,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Stefan Karlik
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or