3

I have a webgrid, what I want to do is to edit the selected row, but I want this action to be performed when the user press a button and not only when the user select the row. How can I do this??

Sergio
  • 53
  • 1
  • 1
  • 6

2 Answers2

1
grid.Column("Action", format: @<text>
                <button class="edit-user display-mode" >Edit</button>
                <button class="save-user edit-mode"  >Save</button>
                <button class="cancel-user edit-mode" >Cancel</button>
                </text>,  style: "col3Width" , canSort: false)

Delete these lines and put into seperate div in coding part

Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
saravanan
  • 11
  • 1
0

I implemented something similar recently, the following article helped me: http://stick2basic.wordpress.com/2013/04/23/inline-editing-with-the-webgrid-in-asp-net-mvc-4/

juju
  • 449
  • 5
  • 16
  • Thankyou, that solution is goood, but Im trying to put the button edit outside the grid, do you know how to do it? – Sergio Sep 06 '13 at 22:38
  • Why in the post the author did `var UserID = tr.find("#UserID").html();` instead of `var UserID = tr.find("#UserID").val();`? – Dylan Czenski Jun 06 '16 at 21:30