Hi
How to insert a image column in kendo grid view. I am using MVC 5 with kendo. I need to delete a row from gridview and database using delete image link.
Thanks.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gowtham RajamanickamPosted Apr 5, 2015, 1:29 AM
neel kPosted Mar 17, 2015, 11:28 AM
Guest UserPosted Mar 17, 2015, 11:21 AM
neel kPosted Mar 17, 2015, 11:13 AM
Guest UserPosted Mar 17, 2015, 11:09 AM
neel kPosted Mar 17, 2015, 11:07 AM
Guest UserPosted Mar 17, 2015, 11:02 AM
neel kPosted Mar 17, 2015, 11:01 AM
Guest UserPosted Mar 17, 2015, 10:57 AM
Add JsonRequestBehavior.AllowGet as a parameter to the Json() method.
neel kPosted Mar 17, 2015, 10:51 AM
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
Guest UserPosted Mar 17, 2015, 10:48 AM
neel kPosted Mar 17, 2015, 10:46 AM
public ActionResult ManageUsers([DataSourceRequest]DataSourceRequest request, external_applications application, string appname)
{
TempData["AppID"] = application.id;
TempData["AppName"] = appname;
IQueryable users = (from c in db.SP_ManageUsers() where c.appid == application.id select c).AsQueryable();
//return View(users.ToList());
return Json(users.ToDataSourceResult(request));
}
I got an error "The result of a query cannot be enumerated more than once."
Guest UserPosted Mar 17, 2015, 10:39 AM
It would need to look something like this:
neel kPosted Mar 17, 2015, 10:34 AM
Guest UserPosted Mar 17, 2015, 10:31 AM
neel kPosted Mar 17, 2015, 10:29 AM
Guest UserPosted Mar 17, 2015, 10:25 AM
neel kPosted Mar 17, 2015, 10:20 AM
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns => {
columns.Bound(c => c.ad_user_id).Title("User").Groupable(false).HeaderHtmlAttributes(new { style = "font-size:18pt;" });
columns.Bound(c => c.title).Title("Title Description").HeaderHtmlAttributes(new { style = "font-size:18pt;" });
columns.Bound(c => c.date_created).ClientTemplate("#= kendo.toString(date_created,\"MM/dd/yyyy hh:mm:ss tt\") #").Title("Created Date").HeaderHtmlAttributes(new { style = "font-size:18pt;" }); columns.Template(@
.HtmlAttributes(new { style = "height: 380px;" })
.Scrollable() .Groupable() .Filterable()
.Sortable(sortable => sortable.AllowUnsort(true).SortMode(GridSortMode.MultipleColumn)) .Pageable(pageable => pageable .PageSizes(true) .ButtonCount(5))
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(20)
.Batch(true)
.Model(model => model.Id(p => p.ad_user_id))
.Destroy(delete => delete.Action("Remove", "ExternalApplications"))
.Read(read => read.Action("ViewChangeLogs", "ExternalApplications"))
)
)
Guest UserPosted Mar 17, 2015, 10:12 AM
neel kPosted Mar 17, 2015, 10:08 AM
Guest UserPosted Mar 17, 2015, 10:00 AM
neel kPosted Mar 17, 2015, 9:57 AM
columns.Template(@
Can you please give me the controller code for row delete operation.
Guest UserPosted Mar 17, 2015, 9:51 AM
Using the class k-grid-delete triggers the delete command from the grid. I assumed you already had those events connected. This is what you would need to add:
Controller code would have:
public ActionResult YourControllerDeleteAction([DataSourceRequest] DataSourceRequest request, ViewModel viewModel)
{
// here you can use viewModel.Id to delete your record
}
neel kPosted Mar 17, 2015, 9:46 AM
Guest UserPosted Mar 17, 2015, 8:38 AM
@(Html.Kendo().Grid
.Name("grid")
.Columns(columns =>
{
columns.Template(@
})
)