Unplanned
Last Updated: 04 Nov 2021 13:29 by ADMIN
Tom
Created on: 01 Oct 2021 00:49
Category: Grid
Type: Feature Request
4
For the Grid - be able to specify a foreign key list of objects to use for display values in the grid/filter list/grouping list

Right now you can create a template in the grid to display text from a list based on the foreign key in the grid data. For example, if your database has a table user list and a table role. The Role table has an integer Id primary key column and a text Description column. The user table has a foreign key integer column that is the Role Id. You can bring all the data over when you call up the data (flattening the data) or you can just bring over the foreign key integer value for the role and then create templates.

The situation is described here:

https://docs.telerik.com/blazor-ui/knowledge-base/grids-foreign-key

When you do not flatten the data, you would need to retrieve the role collection and then reference that data in templates in the grid. You need a template for the grid itself, a template for filtering, and a template for the grouping. Maybe more that I am not finding?

What would be great is if you could simply set the foreign key collection for the column and not have to create any templates. You would have to also set what the Id and display text fields are on the collection also so the grid would know what data to use for finding and displaying the desired data. You could require a standard collection with standard field names and then we would have to project the values into it from our other collections using linq.

4 comments
ADMIN
Dimo
Posted on: 04 Nov 2021 13:29

Hi Tom,

Thanks for the follow-ups. Yes, what you say makes sense.

Note that the foreign key column in the ASP.NET Core Grid does not support sorting by the "text field" out-of-the-box and a bit of additional coding is required. At this point, I can't say how exactly this will work in the Blazor Grid.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tom
Posted on: 04 Nov 2021 12:36
Also, the displayed text should be used for all shaping of the data in the grid, like sorting, grouping, filtering, etc. It should appear to the end user like the displayed data is the data. The grid should not use the foreign key value for anything except getting the displayed value.
Tom
Posted on: 07 Oct 2021 13:34
Yes, that example is similar. The syntax will be different for Blazor but it is the same concept of specifying what field, a collection, and the properties on that collection that are used. I see in the example that the display text appeared in the grouping and editing so I am assuming that it would be the same for Blazor. The developer should also be able to create a template if they wish and use a property of the collection for the display text.
ADMIN
Dimo
Posted on: 07 Oct 2021 12:05

Hello Tom,

We have a similar feature in our ASP.NET Core Grid, so I am marking this as a valid feature request. We will prioritize it based on popularity and demand.

Looking at the linked demo, is this what you imagine for the Blazor Grid?

Regards,
Dimo
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.