This question is locked. New answers and comments are not allowed.
Hi
I have a small issue with inline grid editing. Everything appears to work as expected except for the delete. The delete deletes the row from the database and returns the gridview less the row deleted but the gris does not refresh corrcetly.
Here is the defintion of the grid.
and here is the delete code.
I have checked the result set returned after the delete doesn't include the deleted row. The only way to corrcet the grid so far is to click the refresh button.
Hope this is clear.
John
I have a small issue with inline grid editing. Everything appears to work as expected except for the delete. The delete deletes the row from the database and returns the gridview less the row deleted but the gris does not refresh corrcetly.
Here is the defintion of the grid.
<%: Html.Telerik() _ .Grid(Of AIMSModels.UserIPItemModel)() _ .Name("UserIPSummaryGrid") _ .DataKeys(Function(keys) keys.Add(Function(o) o.UserIpID)) _ .ToolBar(Function(commands) commands.Insert().ButtonType(GridButtonType.Text)) _ .Columns(Sub(columns) columns.Bound(Function(o) o.IPStart).Width(150).Title("Starting IP Range") columns.Bound(Function(o) o.IPEnd).Width(150).Title("Ending IP Range") columns.Bound(Function(o) o.ScreenSaverID).Width(150).Title("Extended ScreenSaver").ClientTemplate("<#= ScreenSaver #>") columns.Command(Sub(commands) commands.Edit().ButtonType(GridButtonType.Text) commands.Delete().ButtonType(GridButtonType.Text) End Sub) End Sub) _ .DataBinding(Sub(dataBinding) dataBinding.Ajax() _ .Select("_AjaxUserIPSummary", "User") _ .Insert("_AjaxUserIPInsert", "User", New With {.UserID = Model.UserID}) _ .Update("_AjaxUserIPUpdate", "User", New With {.UserID = Model.UserID}) _ .Delete("_AjaxUserIPDelete", "User", New With {.UserID = Model.UserID}) End Sub) _ .Resizable(Function(resizing) resizing.Columns(True)) _ .Scrollable(Function(scrolling) scrolling.Height(250)) _ .Scrollable(Function(scrolling) scrolling.Enabled(True)) _ .Editable(Function(editing) editing.Mode(GridEditMode.InLine)) _ .ClientEvents(Function(events) events.OnEdit("onEdit")) _ .Footer(True)%>and here is the delete code.
Function _AjaxUserIPDelete(ByVal id As Integer, ByVal Model As UserIPItemModel) As ActionResult Model.UserIpID = id Model.Delete() Return View(New GridModel(UserIPViewModel.GetUserIPItems(Model.UserID))) End FunctionI have checked the result set returned after the delete doesn't include the deleted row. The only way to corrcet the grid so far is to click the refresh button.
Hope this is clear.
John