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

RadGrid UpdateCommand not firing

1 Answer 114 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Shawn asked on 24 Sep 2015, 02:54 PM


The Update command does not work when I try to update values inside a RadGrid that resides inside a UserControl.  

The UserControl is loaded into a TabStrip tab when the tab is clicked by the user.  This is the code that loads the user control:

UserControl ctrl = (UserControl)LoadControl(controlName);
string userControlID = controlName.Split('.')[0];
userControlID = userControlID.Replace("/", "").Replace("~", "") + "_UC";
ctrl.ID = userControlID;

I'm using Advanced Databinding for the Radgrid like so:

protected void rgdHousingVersion_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    rgdHousingVersion.DataSource = BLL.GetAHUHousingVersions();

And here's the HTML for the UserControl:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadAjaxManagerProxy ID="rampAdminHousingVersion" runat="server">
        <telerik:AjaxSetting AjaxControlID="rgdHousingVersion">
                <telerik:AjaxUpdatedControl ControlID="rgdHousingVersion" />
<telerik:RadGrid ID="rgdHousingVersion" runat="server"
    OnEditCommand="rgdHousingVersion_EditCommand" OnUpdateCommand="rgdHousingVersion_UpdateCommand"
    <MasterTableView DataKeyNames="HousingID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="InPlace" EnableViewState="true">
            <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="~/Images/Graphics/16/Change_16.png"></telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="HousingID" HeaderText="Housing ID" UniqueName="HousingID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Reference" HeaderText="Reference" UniqueName="Reference"></telerik:GridBoundColumn>
            <EditColumn ButtonType="ImageButton" />

Here's the code-behind for the OnEditCommand and OnUpdateCommand:

protected void rgdHousingVersion_EditCommand(object sender, GridCommandEventArgs e)
    //Does fire
protected void rgdHousingVersion_UpdateCommand(object sender, GridCommandEventArgs e)
    //Does NOT fire

I'm really not sure what I'm doing wrong.  Why is the UpdateCommand not firing?  Any help is appreciated.  I have not been able to find an answer to this problem anywhere.  Thanks!


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 29 Sep 2015, 08:50 AM
Hi Shawn,

I examine the provided code but I am not sure on which event you add the user control dynamically. Keep in mind a suitable event is PageViewCreated as demonstrated in the following help article.

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 Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question