Is Group By Supported?

4 posts, 0 answers
  1. Brendan Enrick
    Brendan Enrick avatar
    28 posts
    Member since:
    Jul 2009

    Posted 12 Nov 2009 Link to this post

    Is it possible to perform a group by to get grouped results with aggregate functions?
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 13 Nov 2009 Link to this post

    Hello Brendan Enrick,

    It is possible perform a group by to get grouped results with aggregate functions. To achieve this goal you should do a query of the following format:

    var customers =
        from c in scope.Extent<Customer>()
        group c by c.Country into g
        select new { Key = g.Key, Count = g.Count() };

    I think that will help you.

    Kind regards,
    Damyan Bogoev
    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.
  3. DevCraft banner
  4. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 25 Sep 2014 in reply to Damyan Bogoev Link to this post

    Is there way to do something like this using the OpenAccessLinqDataSource, or can it only be done through code-behind?
  5. Doroteya
    Doroteya avatar
    495 posts

    Posted 29 Sep 2014 Link to this post

    Hello Derek,

    It is possible to achieve the same result with OpenAccessLinqDataSource. An example of the implementation is available in the Data Binding with OpenAccessLinqDataSource sample (the Using Aggregates on Grouped Data section) in our Samples Kit. The exact settings are available in the documentation of the sample, the Using Aggregates on Grouped Data task. You can open the documentation by selecting the sample in the samples grid and clicking on the Open Documentation... button.

    I hope this helps. If you need additional information, do not hesitate to get back to us.

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top