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

[Solved] Command button only calling "Select" data binding method

2 Answers 146 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.
Mark
Top achievements
Rank 1
Mark asked on 20 Jun 2011, 01:40 PM
I have a Grid with the command buttons enabled and server binding defined for them.  I am using inline editing.  When I click on the Edit button a call is made to the "Select" binding method "GridEdit".  After I make my edits I click on the update button a call is made to the same method "GridEdit".  It should be making a call to the "UpdateGrid" method.  Also, when I click on the delete button is makes a call to the "GridEdit" method.  Below is the code for my Grid.

Where do I start to troubleshot this issue?  Why are all the command going to the select binding method?

Thanks


        .DataKeys(keys => keys.Add(o => o.Id))
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText))
        .Columns(columns =>
        {
            columns.Bound(o => o.Name).Title("Name").Filterable(true);
            columns.Bound(o => o.Title).Title("Title");
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.ImageAndText);
                commands.Delete().ButtonType(GridButtonType.ImageAndText);
            }).Width(180).Title("Commands");
        })
        .DataBinding(dataBinding =>
                    {
                        dataBinding.Server()
                              .Select("EditGrid", "Account")
                              .Insert("InsertGrid", "Account")
                              .Update("UpdateGrid", "Account")
                              .Delete("DeleteGrid", "Account");
        })

2 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 27 Aug 2011, 12:57 AM
I am having the exact same thing happen. Have you found a resolution to this? Can anyone at Telerik offer any insight?

I have another grid on the same page that uses .Ajax() binding and it calls the appropriate method. 

This seems like a bug.
0
Richard
Top achievements
Rank 1
answered on 27 Aug 2011, 05:07 AM
Try changing this block from:
.DataBinding(dataBinding =>
                    {
                        dataBinding.Server()
                              .Select("EditGrid", "Account")
                              .Insert("InsertGrid", "Account")
                              .Update("UpdateGrid", "Account")
                              .Delete("DeleteGrid", "Account");
        })

To:

.DataBinding(dataBinding =>
                    {
                        dataBinding.Server().Select("EditGrid", "Account");
                        dataBinding.Server().Insert("InsertGrid", "Account");
                        dataBinding.Server().Update("UpdateGrid", "Account");
                        dataBinding.Server().Delete("DeleteGrid", "Account");
        })

Hope this helps.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or