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

LINQ Expression for group by columns

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vatsal
Top achievements
Rank 2
Vatsal asked on 25 Jun 2013, 04:34 PM
Hi,

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" />
        </telerik:RadGrid>

After set few filters and groups,

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

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.

Thanks


1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 28 Jun 2013, 07:07 AM
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.

Regards,
Antonio Stoilkov
Telerik
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.
Tags
Grid
Asked by
Vatsal
Top achievements
Rank 2
Answers by
Antonio Stoilkov
Telerik team
Share this question
or