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

UpdateCommand not fired!

6 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 12 Dec 2008, 05:58 AM
I have a couple of dynamic RadGrids generated in Page_load(). The Grids have GridEditCommandColumn, which turned the rows to edit mode when the edit button was clicked. The problem was when I tried to update the items in the row, the e.CommandName always equaled to "Delete", and UpdateCommand event hanlder was never fired.

So the RadGrid actually performed row delete function instead. Can anyone help me sovle the problem?

Thanks a lot in advance! 

RadGrid1.UpdateCommand += new GridCommandEventHandler(RadGrid1_UpdateCommand);

RadGrid1.ItemCommand +=

new GridCommandEventHandler(RadGrid1_ItemCommand);

protected
void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)

 

 

{
    ........

}

 

 

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)

{

 

 

    if (e.CommandName == RadGrid.DeleteCommandName)
    {
        .......
    }
}

 

 

 

 

 

 

 

 

 

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Dec 2008, 08:28 AM
Hi Richard,

Are you using an AutoGeneratedEditForm or custom editform ? If you are using a custom edit form(form template or webusercontrol) check whether you have set the CommandName of the Update button as 'Update'.

Shinu
0
Richard
Top achievements
Rank 1
answered on 12 Dec 2008, 12:43 PM
I didn't use custom edit form. The edit mode was set to in place, and all GridBoundColomns would turn into editable textboxes if the edit button was clicked.
0
Imthiyas
Top achievements
Rank 1
answered on 23 Dec 2008, 10:23 AM
Hi,

I am getting a similar problem.

I have created two template columns statically and remainig columns dynamically.

On click of edit the Template columns are getting changed to edit mode. But on click of Update the UpdateCommand of the rad grid is
not getting fired.

Thanks
0
Sebastian
Telerik team
answered on 23 Dec 2008, 11:01 AM
Hello Imthiyas ,

Mixed load of columns (declarative and runtime) is not supported by our web grid as depicted in this topic from the online documentation. Please revise your code and verify that you are using advanced data-binding through the NeedDataSource event.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Imthiyas
Top achievements
Rank 1
answered on 23 Dec 2008, 11:49 AM
Thanks for quick update.

So are you saying me to create all the columns including the template columns dynamically.

if so please send me a sample code.

The requirement is to generate bound columns and template columns(for editing) along with a Grid Edit Column which contain the edit button.

Thanks.
0
Sebastian
Telerik team
answered on 23 Dec 2008, 12:25 PM
Hi Imthiyas ,

The code is available in the help article linked in my previous post (see the bottom section).

Regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Richard
Top achievements
Rank 1
Imthiyas
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or