Need More Info
Last Updated: 17 Nov 2021 23:17 by ADMIN
Robert
Created on: 11 Oct 2021 14:43
Category: Grid
Type: Feature Request
6
FieldExpression for grid

I suggest adding a FieldExpression property to the GridColumn so a developer would not need to create view models and templates for simple transformations of the existing model's properties. The field expression would be used for filtering and sorting as well. Its type would be Func<T, object> or Expression<Func<T, object>>.

 

   <TelerikGrid Data="@Persons">
            <GridColumns>
                <GridColumn FieldExpression="@(p => p.FirstName + " " + p.LastName)" />
            </GridColumns>
        </TelerikGrid>

8 comments
ADMIN
Joana
Posted on: 17 Nov 2021 23:17

Hello Robert,

We appreciate your feedback.

Going into the direction of supporting functional oriented data would move the focus away from our main solution - providing UI component library. Our mission is to provide UI components that are not related to any business logic or data layer but rather components that are flexible and easy to plug-in in any application. That is why supporting such features is related to huge rework, because we have never evaluated taking this path. However, we do value the details you shared and we marked the feature with `Need More Info` to collect more data on the request.

Thank you once again.

Regards,
Joana
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Robert
Posted on: 12 Nov 2021 15:09

Hello Joana,

thanks for your clarification.

I think it would be more than worth for you to invest the time and energy to upgrade Telerik Blazor Grid to support such a feature, for Blazor is functional oriented UI framework.

Moreover, recent development trends of C# language itself go strongly into functional oriented direction (pattern matching, switch expression, records, with operator,  lambda expression improvements, inferred return type etc.), so I am sure that implementing functional oriented data binding, beside the existing traditional object oriented one, would be the best decision for all of us.

ADMIN
Joana
Posted on: 11 Nov 2021 18:51

Hello Robert,

Thank you for sharing your request and giving your suggestions.

We have thorougly evaluated the suggested feature. I would like to cover the two aspects of this request - usage instead of template and usage for data operations.

Talking about the benefit of the feature to substitute template usage - this can be implemented to bring easy way of our customers to moderate the content.

However, in regards of our datasource that is responsible for all data operations - currently, it relies on the definition of a string field member. Defining expressions for every operations would flood the clean API that we seek to maintain, and would require huge rework of the datasource. The communication between the Grid and Datasource is fully functional and such ground breaking changes come at a high cost. So, in order to consider going to this direction we need strong justification and demand.

That being said, we will mark the FR with `Need More Info`, and will kindly ask our customers to share their input of why the expressions are needed feature for their use cases - whether they want it to be an alternative for template, or they want data operations as well.

I hope that the above explanation makes sense.

Regards,
Joana
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Robert
Posted on: 10 Nov 2021 13:44

BTW: the proposed feature has been well proven and successfully used is some other frameworks/widgets we have used by ourselves:

https://datatables.net/

http://objectlistview.sourceforge.net/cs/index.html

Anonymous functions instead of view models are very productive, effective and comfortable to use solution. And in compliance with recent trends by Microsoft C# development which inclines more and more into the function oriented programming instead of the OO.

Robert
Posted on: 10 Nov 2021 13:15
A fully generic FieldExpression declaration like Func<TRowItem, TCellValue> might be better in order to spare the FieldType declaration.
Robert
Posted on: 08 Nov 2021 12:36
The proposed feature would also solve a problem of column binding to dictionary keys or to nested lists.
Robert
Posted on: 13 Oct 2021 08:16
And maybe even ExportExpression for Excel (or some other) data export.
Robert
Posted on: 11 Oct 2021 15:29
A possible extension would be adding SortExpression and FilterExpression properties as well.