Grid Delete row

5 posts, 0 answers
  1. Jim
    Jim avatar
    35 posts
    Member since:
    May 2011

    Posted 30 Jun 2015 Link to this post

    Hi, I currently have a kendo grid bound to a tempdata item which is a list of objects, on delete i remove the item that is being deleted from the tempdata item list , how can i refresh the grid ?  I tried returning the partial view that the grid is in but the partial view renders in the entire page even though i have it in an ajax.beginform, basically how can I make the partial view that contains the grid referesh in the delete action of the grid?
  2. Graeme
    Graeme avatar
    5 posts
    Member since:
    Jun 2015

    Posted 01 Jul 2015 Link to this post

    Add an event to the Grid.DataSource.Ajax.Events

        RequestEnd("Grid_PostAction")

    add a function to your javascript

       function PickListEditableGrid_PostAction(e) {
           if (e.type != "read") {
               $("#Grid").data("kendoGrid").dataSource.read();
           }
       }

  3. Jim
    Jim avatar
    35 posts
    Member since:
    May 2011

    Posted 02 Jul 2015 Link to this post

    The problem is that if i set my action for destory only remove the tempdata item and not do anything else the page refreshes as blank:

     

     public void DeleteUser([Kendo.Mvc.UI.DataSourceRequest] Kendo.Mvc.UI.DataSourceRequest request,
                 UserDTO user)
             {
                 (new Models.ProjectModel()).DeleteUser(user.UserID);
                 SetAccountUsers();
             }

  4. Jim
    Jim avatar
    35 posts
    Member since:
    May 2011

    Posted 02 Jul 2015 Link to this post

    SetAccountUsers() is where i refetch the user list and assign it to the tempdata item
  5. Jim
    Jim avatar
    35 posts
    Member since:
    May 2011

    Posted 02 Jul 2015 Link to this post

    never mind i had the unobtrusive script at the bottom of the page after the partial view rendering code, i just needed to put it at the top of the page and everything works fine.

     

    thanks

Back to Top