This question is locked. New answers and comments are not allowed.
Ajax binding. i'm trying to create grid with custom Edit button, and Insert form. What is the best way?
1. While inline editing ProjectName and EventDate are editable (as supposed). But while PopUp editing all fields are being displayed. How to fix it?
2. If there are no
3. If i use custom Edit controls, while pressing Delete I can't return grid action
[GridAction]
public ActionResult Delete(int id)
{
if (ModelState.IsValid)
{
repo.DeleteProject(id);
}
//ERROR return View(new GridModel(repo.GetProjects()));
return RedirectToAction("Index");
}
My model:
[ReadOnly(true)]
public int ProjectId { get; set; }
[Required(ErrorMessage = "*")]
[DisplayName("Name")]
public string ProjectName { get; set; }
[Required(ErrorMessage = "*")]
[DisplayName("Event date")]
[DataType(DataType.Date)]
public DateTime EventDate { get; set; }
[ReadOnly(true)]
[DisplayName("XLS timming file")]
public string TimmingFileName { get; set; }
[ReadOnly(true)]
[DisplayName("Edit")]
public string Edit
{
get
{
return (ProjectId == -1)
? String.Empty
: "<a href='/Project/Details/"
+ ProjectId + "'>Details</a> | <a href='"
+ "/Project/Delete/" + ProjectId + "' >Delete</a>";
}
}
TIA
1. While inline editing ProjectName and EventDate are editable (as supposed). But while PopUp editing all fields are being displayed. How to fix it?
2. If there are no
columns.Command(commands =>Insert form doesn't display (only X). How to display pop up for inserting without using edit, delete buttons?
{
commands.Edit();
commands.Delete();
}).Width(200);
3. If i use custom Edit controls, while pressing Delete I can't return grid action
[GridAction]
public ActionResult Delete(int id)
{
if (ModelState.IsValid)
{
repo.DeleteProject(id);
}
//ERROR return View(new GridModel(repo.GetProjects()));
return RedirectToAction("Index");
}
My model:
[ReadOnly(true)]
public int ProjectId { get; set; }
[Required(ErrorMessage = "*")]
[DisplayName("Name")]
public string ProjectName { get; set; }
[Required(ErrorMessage = "*")]
[DisplayName("Event date")]
[DataType(DataType.Date)]
public DateTime EventDate { get; set; }
[ReadOnly(true)]
[DisplayName("XLS timming file")]
public string TimmingFileName { get; set; }
[ReadOnly(true)]
[DisplayName("Edit")]
public string Edit
{
get
{
return (ProjectId == -1)
? String.Empty
: "<a href='/Project/Details/"
+ ProjectId + "'>Details</a> | <a href='"
+ "/Project/Delete/" + ProjectId + "' >Delete</a>";
}
}
TIA