Need More Info
Last Updated: 26 Aug 2020 17:23 by ADMIN
Ben Hayat
Created on: 15 May 2020 02:14
Category: UI for Blazor
Type: Feature Request
3
Show different columns in the popup edit form than are shown in the grid

ADMIN EDIT: Please review this thread and add your comments so we can get the community feedback on this.

Hello Team;

The Grid Popup is a great feature, but my understanding is that the Popup form ONLY shows properties that are assigned as columns to the Grid.
If true, this poses some restrictions for us. Many times we might show ONLY small # of columns in Grid, however the form requires MORE properties during ADD or UPDATE.
Is it possible that we can use two ViewModels, one for the Grid columns with less properties and one with more properties for ADD & UPDATE?

Note: If this FR is considered, perhaps we can have separate ViewModel for Update and ADD, as sometimes, ADD might require more properties to be added than later be updated.

This feature will save a lot of time to build apps that have many tables and we have to create CRUD operations

7 comments
ADMIN
Marin Bratanov
Posted on: 26 Aug 2020 17:23

Hi again,

With the upcoming 2.17.0 release, the columns will have a Visible parameter that you can toggle when the grid is in edit/insert mode. I am attaching here a small sample and a video of the expected that shows how that would work. Would that be suitable behavior, or would you expect something else from the grid (we still do not find the that third bullet to be a well-defined scenario for the grid).

 

Regards,
Marin Bratanov
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/.

Attached Files:
ADMIN
Marin Bratanov
Posted on: 20 Jul 2020 07:18

Hello Andrew,

A Visible parameter is likely to get exposed for this one. It would, however, control the general column visibility in both the grid, and the popup. Perhaps you might be able to toggle it in the OnEdit event, but I can imagine this would be rather cumbersome.

That said, how you you expect a parameter to control the visibility of a column in the popup, considering it is not declared in the grid? At the moment, for a column to be visible AND editable in the grid it must be declared. If you set its Editable parameter to false, it won't show up in the popup editor at all (there is also a way to make it non-editable through data-annotation attributes, see here).

So, I can see the following three scenarios:

  • you want to both show a field and edit it - just declare a column for it
  • you want to show a column but not edit the given field - you declare a column but set its Editable parameter to false
  • you want to NOT show a column, but edit its field - that's the scenario that is unclear and we find confusing. How would you expect that to be exposed for configuration?

 

 

Regards,
Marin Bratanov
Progress Telerik

Andrew
Posted on: 19 Jul 2020 01:34
I thinking having an IsVisible parameter on the GridColumn would be suffice. I get why you're wanting to limit confusion, but setting a grid column with such parameter should be enough of an explicit way of doing so. Just like with your Editable parameter. Please reconsider this, as although this can be achieved through a custom template as you said, having this option should provide additional flexibility within the control realms itself.
Ben Hayat
Posted on: 15 May 2020 16:10
Then I'm happy with Custom form. :-)
Thank you my friend!
ADMIN
Marin Bratanov
Posted on: 15 May 2020 13:34

Hello Ben,

With a custom edit form you can edit however many fields you like, and you can even switch models as suitable for your app - the grid will not be limiting or controlling that in any way.

To take the example - if you define 3 out of the 5 fields of the model in the grid, you can have the following behavior:

  • the built-in popup editing will let you edit/insert those three
  • a custom form can let you edit all 5, a subset of them, or an entirely different model

For cases where you want the grid to show one thing, but the user to see another, a custom form is the solution we have - the grid offers API to let you invoke that form with the desired business logic.

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Ben Hayat
Posted on: 15 May 2020 13:17

Hi Marin;

>>Thus, at this point we believe that the best way to handle such cases is to use a custom edit form<<

Let me see if I understand you correctly; Say, I have a Customer model, that has 5 properties. I assign 3 properties to the grid, to keep the size down. Are you saying, with Custom Edit Form, I can edit ALL the 5 properties of Customer model or ONLY the 3 that I assigned to Grid?

What I was trying to say in my original post was, we usually need more properties to edit than what is shown in the grid.
If we have a large model and we need to edit most of the properties or create those, it would make the grid too big and too much data has to be transferred. I don't mind staying with a single model, but we need to be able (as an option) to be able to declare what properties to be in Edit form and Create for. If this declaration has not been set by developer, then the default would be the properties assigned to Grid.

Hope this clarifies my point.
Thanks!
..Ben

 

ADMIN
Marin Bratanov
Posted on: 15 May 2020 12:42

Hi Ben,

The popup shows only the editable fields defined in the grid. If you set Editable=false to a column it won't appear in the popup. The goal is to have a clear visual mapping between what the user sees in the grid and the edit form so they don't get confused.

Also, the grid can be bound to one model - it is used for displaying, inserting, editing and deleting records, and using a different one would pose several major problems - unnecessary code complexity notwithstanding, it will be a breaking change for everyone (including people who don't need or use such a feature), and it will cause confusion for the users to see one thing in the grid, another when editing, and a third when inserting a record.

Thus, at this point we believe that the best way to handle such cases is to use a custom edit form as shown in this sample project https://github.com/telerik/blazor-ui/tree/master/grid/custom-popup-form or in this demo: https://demos.telerik.com/blazor-ui/grid/editing-custom-form. This will let you use whicever models you want in the forms, and have different forms for editing and inserting - the grid allows you to have full flexibility in this regard, while handling the most common scenarios out-of-the-box.

On large models with a lot of fields - the AutoGeneratedColumns can let you do that, and they also let you specify fields to skip and read-only fields: https://docs.telerik.com/blazor-ui/components/grid/columns/auto-generated.

That said, I am keeping this open for a while so we can gather some more feedback on this to see if anyone else wants to see the same thing.

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.