LINQ Expression for group by columns

2 posts, 0 answers
  1. Vatsal
    Vatsal avatar
    26 posts
    Member since:
    Oct 2010

    Posted 25 Jun 2013 Link to this post


    I have below grid with dynamic columns at runtime.
    <telerik:RadGrid ID="radGridData" runat="server" ShowGroupPanel="true" OnNeedDataSource="radGridData_NeedDataSource">
                <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" />
                <MasterTableView EnableLinqGrouping="true" AllowFilteringByColumn="true" GroupLoadMode="Client" />
                <ClientSettings AllowDragToGroup="true" />

    After set few filters and groups,

    I am able to get linq expression as string for filter columns, with below code:

    But not able to get linq expression as string for group by columns.

    Is there any way to get linq expression for group by columns? I am using LINQ Dynamic Query Library in my code that's why I need it.

    Please let me know if it's possible.


  2. Antonio Stoilkov
    Antonio Stoilkov avatar
    530 posts

    Posted 28 Jun 2013 Link to this post

    Hello Vatsal,

    You could achieve your scenario by manually calling the LINQ Dynamic Query Library GroupBy method for every GroupByExpression in the GridTableView GroupByExpressions collection. Note that there is no individual expression for the grouping because the GroupBy method should be called multiple times for each GroupByExpression that is the reason GridTableView.GroupByExpressions is available.

    Antonio Stoilkov
    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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top