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

[Solved] GridEditMode.PopUp - how much can you control edit?

3 Answers 236 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Colin
Top achievements
Rank 1
Colin asked on 29 Aug 2010, 05:10 PM
Hi,

Saw the new popup feature which I think looks very nice. I was wondering:

How can you control what fields are shown in the popup? I have a class and every property is shown even it is not bound to the grid
Can you define your own complete edit template i.e. almost like an edit view rather than let the grid determine it? Or in fact just specify a view to popup and pass it the model to?

One reason I ask is I would very much like to use the new Editor control for some textbox inputs and the popup edit mode would be ideal for this.

Thanks
Colin

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 30 Aug 2010, 07:39 AM
Hello Colin,

I suggest you check the grid editing configuration help topic. You can customize the template generated for the edit form by defining a template for your object. A good tutorial can be found in this blog post.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Colin
Top achievements
Rank 1
answered on 30 Aug 2010, 07:34 PM

Those links are excellent especially the 2nd one thanks.

I have struggled with complex types and the grids especially where a property of the parent class has a list of the child class. I am hopeful this will help me solve this.

I noticed also that the data passed from a grid is now a set of values and not the form collection in the latest version. As I had a grid like:

.Columns(columns =>
{
    Action<int> addValueColumn =
        (i) => { columns.Bound(u => u.BIRPs[i].Value).ClientTemplate("<#= BIRPs[" + i + "].Value #>").Width(140).Title("Recovery Phase " + (i + 1).ToString()).Filterable(false); };
    columns.Bound(u => u.CriticalProcessName).Width(140).ReadOnly(true);
    columns.Bound(u => u.LocationName).Width(140).ReadOnly(true);
    for (int i = 0; i < Model.FirstOrDefault().BIRPs.Count; i++)
    {
        addValueColumn(i);
    }
      
    columns.Bound(u => u.DailyLossId).ClientTemplate("<#= DailyLossValue #>").Width(90).Filterable(false);
    columns.Bound(u => u.Comments).Width(120).Filterable(false);
    columns.Bound(u => u.CriticalEvents).Width(120).Filterable(false);
    columns.Bound(u => u.MTPOD).Width(70).Filterable(false);
    columns.Bound(u => u.RTO).Width(70).Filterable(false);
    columns.Command(commands =>
    {
        commands.Edit();
        //commands.Delete();
    }).Width(180).Title("Commands");
    columns.Bound(u => u.ImpactAreaId).ClientTemplate("<#= ImpactAreaName #>").Hidden(true);
})

my controller accepted a FormCollection. Previously this would get each column added in the loop as an item in the form collection but now I only get the first item. I intercepted the onSave event and notice it looked like the value property was sent to the controller and not the formItems. Is this true?

What is the best way to handle something like above? I suspect a popup form with a template is a better option for editing?
0
Atanas Korchev
Telerik team
answered on 31 Aug 2010, 08:04 AM
Hello Colin,

I am not sure I understand what the problem is. Popup and inline modes should operate in the same way when it comes to posting data. I suggest you send a sample project showing the problem at hand.

Kind regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Colin
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Colin
Top achievements
Rank 1
Share this question
or