This question is locked. New answers and comments are not allowed.
The command buttons don't show up in my grid, i hope someone can give me some suggestion.
The grid code is simple, i just want to show the data and add each row 2 button:
| <%= Html.Telerik().Grid<UserInfo>() |
| .Name("Grid") |
| .DataKeys(keys => |
| { |
| keys.Add(c => c.id); |
| }) |
| .DataBinding(dataBinding => |
| { |
| dataBinding.Ajax() |
| .Select("_delete", "Home") |
| .Update("_delete", "Home") |
| .Delete("_delete", "Home"); |
| }) |
| .Columns(columns => |
| { |
| columns.Bound(c => c.id); |
| columns.Bound(c => c.name).Width(170); |
| columns.Command(commands => |
| { |
| commands.Edit(); |
| commands.Delete(); |
| }).Width(180).Title("Commands"); |
| }) |
| .Pageable() |
| .Scrollable() |
| .Sortable() |
| %> |
And the delete action code is like:
| [HandleError] |
| public class HomeController : Controller |
| { |
| public ActionResult Index() |
| { |
| return View(); |
| } |
| [GridAction] |
| public ActionResult _delete(string id) |
| { |
| InfoEntities _entities = new InfoEntities(); |
| var user = (from u in _entities.UserInfo |
| select u).ToList(); |
| return View(new GridModel(user)); |
| } |
| public ActionResult About() |
| { |
| return View(); |
| } |
| } |
The data retrieved from the database in the grid is right, but the delete button doesn't appear, why?
Which part might be wrong ?