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

Grid Edit popup function not firing

3 Answers 470 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 02 Feb 2015, 04:05 PM
Hi Everyone --

I cannot get my Edit popup window to fire. I don't see any events happening when I debug the application. My add user function works quite well. 

Any ideas why this is?

@(Html.Kendo().Grid<
Areas.Admin.ViewModels.UserManagement.UserManagementVM>()
                .Name("UserProfileGrid")
                .Resizable(c => c.Columns(true))
                .Selectable()
                .Filterable()
                .Groupable()
             .ToolBar(toolbar =>
                    {
                        toolbar.Template(@<text>
 
 
                            <input id="ButtonAddUser" type="button" class='k-button k-grid-add' value="Add User"/>
                            <input id="ButtonEditUser" type="button" class="k-button k-grid-edit" value="Edit user" />
                             
                        @(Html.Kendo().Button()
                        .Name("ButtonRefreshPage")
                        .HtmlAttributes(new { type = "k-button" })
                        .Icon("history")
                        .Content("Refresh Page")
                        .Events(x => x.Click("RefreshPage")))
 
                        @(Html.Kendo().Button()
                        .Name("ButtonDeleteUser")
                        .HtmlAttributes(new { type = "k-button" })
                        .Icon("history")
                        .Content("Delete a user")
                        .Events(x => x.Click("DeleteUser")))
 
                        @(Html.Kendo().Button()
                        .Name("ButtonAbout")
                        .HtmlAttributes(new { type = "k-button" })
                        .Icon("history")
                        .Content("About")
                        .Events(x => x.Click("aboutButtonClick")))
                        </text>);
                    })
 
                    .Editable(editable => editable.Mode(GridEditMode.PopUp)
                    )
 
                    .Columns(columns =>
                    {
                        //columns.Bound(e => e.UserOrg).Width(25).Title("User Organization");
                        columns.Bound(e => e.IsApproved).Width(50).Title("Approved Status");
                        columns.Bound(e => e.UserName).Width(150).Title("User Name");
                        //columns.Bound(e => e.user).Width(150);
                        columns.Bound(e => e.EmailAddress).Width(150).Title("Email Address");
                    })
 
                    .Sortable()
                    .Scrollable()
                    .Pageable()
                    .Filterable()
                    .Selectable()
                    .Events(e =>
                    {
                      e.Change("packageRowSelectionChanged");
                    })
                    .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Events(E => E.Error("error_handler"))
                    .Model(model => model.Id(e => e.UserId))
                    .Read(read => read.Action("ReadUsers", "UserManagement"))
                    .Create(create => create.Action("UserProfileCreator", "UserManagement"))
                    .Update(update => update.Action("UserProfileCreator", "UserManagement"))
                    .Destroy(destroy => destroy.Action("EditingPopUp_Destroy", "UserManagement"))
                    ))

3 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 03 Feb 2015, 02:42 PM
*bump*

Still no idea anyone?
0
Accepted
Rosen
Telerik team
answered on 04 Feb 2015, 09:46 AM
Hello Michael,

In order to use the built-in popup editing functionality of the grid, you will need to use the edit command column as shown in this online demo.
Having a custom button in the toolbar will not trigger the built-in editing. If you want such functionality you could use the editRow method of the Grid and pass the appropriate row element in order to open the popup editor.

Regards,
Rosen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Michael
Top achievements
Rank 1
answered on 04 Feb 2015, 08:49 PM
Thanks Rosen!
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or