This is a migrated thread and some comments may be shown as answers.

[Solved] Why command buttons don't appear?

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Leon Ren
Top achievements
Rank 1
Leon Ren asked on 29 Apr 2010, 04:21 AM

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 ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 29 Apr 2010, 07:53 AM
Hello Leon Ren,

You are probably using ASP.NET MVC 1.0. Editing is supported only in ASP.NET MVC 2.0.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Leon Ren
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or