This question is locked. New answers and comments are not allowed.
I have been looking at your Ajax Editing example, http://demos.telerik.com/aspnet-mvc/razor/Grid/EditingAjax, and converting what I can to Visual Basic, since we are a Visual Basic shop. We also do not use Linq, we pass the values to the stored procedures, and your example looks to be using Linq. Maybe we are in the dark ages, but that is what we do.
We are using the Popup edit form of the grid. We have DataBinding functions for Select, Update, and Insert which you can see in the VB/Razor code below.
I can add the parameter "Id" to my Insert or Update function and will always have the correct Id. So at this point I just want to grab all the values from the popup form and pass them to my stored procedure.
So my questions are...
1) How do I get the values for the current row that I just edited?
2) Refresh the grid row and stay on the current page? We don't want to be on page 5 and end up on page 1 after the refresh.
Thanks!
PS: Visual Basic examples would really be helpful. This weekend I have about 15 hours converting your examples and about 1 hour actually writing code. I know Visual Basic is a minority in MVC 3, but if we could produce faster, we would probably buy more product.
My two-cents. Thanks again!
We are using the Popup edit form of the grid. We have DataBinding functions for Select, Update, and Insert which you can see in the VB/Razor code below.
@(Html.Telerik(). Grid(Model). Name("Grid").Columns(Sub(columns) columns.Command(Function(commands) commands.Edit()).Width(100) columns.Bound(Function(model) model.BrandId).Width(100) columns.Bound(Function(model) model.BrandName) columns.Bound(Function(model) model.DiscountPercent).Width(100).Format("{0:n4}") columns.Bound(Function(model) model.MarkupPercent).Width(100).Format("{0:n4}") columns.Bound(Function(model) model.IsActive).Width(100).Title("Active") End Sub). DataBinding(Function(db) db.Ajax(). Select("SelectBrands", "Masters"). Update("_SaveAjaxEditing", "Masters"). Insert("_SaveAjaxEditing", "Masters")). DataKeys(Function(d) d.Add(Function(model) model.BrandId)). Editable(Function(e) e.Mode(GridEditMode.PopUp)). Filterable(). Pageable(Function(x) x.PageSize(ConfigurationManager.AppSettings("GridPageSize"))). Sortable(). ToolBar(Function(t) t.Insert()))I can add the parameter "Id" to my Insert or Update function and will always have the correct Id. So at this point I just want to grab all the values from the popup form and pass them to my stored procedure.
<HttpPost()><GridAction()>Public Function _SaveAjaxEditing(id As Integer) As ActionResult 'get the values from the grid/poup window 'send the values to the stored procedure 'refresh the gridEnd FunctionSo my questions are...
1) How do I get the values for the current row that I just edited?
2) Refresh the grid row and stay on the current page? We don't want to be on page 5 and end up on page 1 after the refresh.
Thanks!
PS: Visual Basic examples would really be helpful. This weekend I have about 15 hours converting your examples and about 1 hour actually writing code. I know Visual Basic is a minority in MVC 3, but if we could produce faster, we would probably buy more product.
My two-cents. Thanks again!