This question is locked. New answers and comments are not allowed.
I have used the telerik grid which has a delete button in every row. The grid has a few pages, so i move to the 3rd or 4th page (could be any number). On click of the delete button (which is an image), I call a javascript function, which does an ajax postback to a service method, which returns a json boolean reply to me. Based on the value of this boolean variable, I either call a service method to delete the record or to deactivate it. The record is successfully deleted or deactivated from the db. However, this is not reflected in the Grid, until I do a physical refresh (F5). Please help me resolve this issue so that I can see the data refreshed on whichever page I may be.
//View
Html.Telerik().Grid<ModelType>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.ID).Hidden(true);
columns.Bound(o => o.Name).Title("Name")
.... And So on ...
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("_PartialView", "Controller")
.Pageable()
.Sortable()
.Scrollable(scrolling => scrolling.Height("373px")).Filterable()
.Render();
//Controller
public ActionResult DeleteRecord(Guid id)
{
using (var client= new Client())
{
client.DeleteRecord(new request{ id= id });
}
return RedirectToAction("_PartialView");
}
[GridAction]
public ActionResult _PartialView()
{
var model = GetModelData();
return View(new GridModel
{
Data = model
});
}
//View
Html.Telerik().Grid<ModelType>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.ID).Hidden(true);
columns.Bound(o => o.Name).Title("Name")
.... And So on ...
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("_PartialView", "Controller")
.Pageable()
.Sortable()
.Scrollable(scrolling => scrolling.Height("373px")).Filterable()
.Render();
//Controller
public ActionResult DeleteRecord(Guid id)
{
using (var client= new Client())
{
client.DeleteRecord(new request{ id= id });
}
return RedirectToAction("_PartialView");
}
[GridAction]
public ActionResult _PartialView()
{
var model = GetModelData();
return View(new GridModel
{
Data = model
});
}