UpdateCommand (or any other ItemCommand) not firing

9 posts, 0 answers
  1. Hendrik
    Hendrik avatar
    23 posts
    Member since:
    Jan 2008

    Posted 15 Aug 2008 Link to this post

    I've seen a lot of posts about ItemCommand events not firing, but no solution in any of the topics. My problem is simple and shouldn't require a complete code sample or whatever: I have a RadGrid within a UserControl, dynamicaly being loaded on a page, within a PlaceHolder using LoadControl. I use inline editing for the grid, using my own code to update the underlying database. The UpdateCommand fired after clicking the update button in de editcommand column should be the place to do so. Going into edit mode works fine, but when clicking either the cancel button or the update button, doen's fire any event.

    The page structure is like this: Master > Content > RadSplitter > RadPane > RadAjaxPanel > PlaceHolder > UserControl > RadAjaxPanel > RadGrid.

    Please give me a solution for this problem. FYI:'the grid has the OnUpdateCommand property set with my event handlers name and the AllowAutomatedUpdates property is set to true. Everything SHOULD work fine.... but it doesn't.
  2. Konstantin Petkov
    Konstantin Petkov avatar
    1911 posts

    Posted 18 Aug 2008 Link to this post

    Hello Hendrik,

    What I suspect here is a problem with the way of loading the user control dynamically which often appears when using AJAX. To verify that, would you please try removing the AJAX Panels from the setup temporary and see if the events are fired as expected? If I'm right in my assumptions, please review the tutorial available in the documentation here about loading user controls.

    I'd also suggest you switch to the RadAjaxManager/Proxy setup instead. You can read more about that in the following help articles:

    RadAjax and WebUserControls
    Using RadAjaxManagerProxy control

    Konstantin Petkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
  4. David
    David avatar
    4 posts
    Member since:
    Oct 2008

    Posted 01 Dec 2008 Link to this post

    Hi there,
    I am having the same problem. I have wired up my OnUpdateCommand as Hendrik has. I have tried moving the grid to a non-Ajax panel and the update event is still not firing. The ItemCommand is firing as expected (to open the row in edit mode), but when I try to update it, no event gets fired...

    Here is the code for the RadGrid in the ascx; Does everything look right?


    1 <telerik:RadGrid ID="grdGauges" runat="server" Skin="Gray" AutoGenerateColumns="False"   
    2                                                 ShowHeader="false" onupdatecommand="grdGauges_UpdateCommand"   
    3                                                 onitemcommand="grdGauges_ItemCommand" EnableViewState="true"   
    4                                     AllowAutomaticUpdates="true" onitemupdated="grdGauges_ItemUpdated" > 
    5                                     <MasterTableView EditMode="EditForms" DataKeyNames="Type">  
    6                                         <RowIndicatorColumn> 
    7                                             <HeaderStyle Width="20px" /> 
    8                                         </RowIndicatorColumn> 
    9                                         <ExpandCollapseColumn> 
    10                                             <HeaderStyle Width="20px" /> 
    11                                         </ExpandCollapseColumn> 
    12                                         <Columns> 
    13                                             <telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="clEdit"></telerik:GridEditCommandColumn> 
    14                                             <telerik:GridBoundColumn DataField="Type" HeaderText="Type" ReadOnly="true" UniqueName="Type">  
    15                                             </telerik:GridBoundColumn> 
    16                                             <telerik:GridBoundColumn DataField="SerialNumber" HeaderText="Serial No." UniqueName="SerialNumber">  
    17                                             </telerik:GridBoundColumn> 
    18                                         </Columns> 
    19                                     </MasterTableView> 
    20                                     <FilterMenu EnableTheming="True" Skin="Gray">  
    21                                         <CollapseAnimation Duration="200" Type="OutQuint" /> 
    22                                     </FilterMenu> 
    23                                 </telerik:RadGrid> 



  5. Vlad
    Vlad avatar
    11100 posts

    Posted 01 Dec 2008 Link to this post

    Hi David,

    Can you please post a bit more info how this user control is loaded/created?

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. David
    David avatar
    4 posts
    Member since:
    Oct 2008

    Posted 01 Dec 2008 Link to this post

    Hi Vlad,
    thanks for getting back to me.

    I managed to find a simple solution... i've updated my grid so  that it now uses the advanced data binding method, rather than the simple grid.DataBind() method.
    This allowed the UpdateCommand/InsertCommand/DeleteCommand events to be fired, and they still work as expected when I add them to a RadAjaxPanel.

  7. Wveimar
    Wveimar avatar
    14 posts
    Member since:
    Dec 2008

    Posted 15 May 2009 Link to this post

    Hi everybody:

    Verify you don't have any .NET validators (RequiereFieldValidator, CompareValidator, etc) in your page waiting for data. In my case that was the problem.  I have a page with one RadDockLayout, two RadDockZones, and a RadDock inside every zone.  Every RadDock contains a UserControl, and one of them have validators. If those validators get fired when you fired the OnInsertCommand or OnUpdateCommand, none of them will get fired.

  8. Jason Zam
    Jason Zam avatar
    18 posts
    Member since:
    Aug 2009

    Posted 17 Aug 2009 Link to this post

    I've had that same frustrating problem as well.  Like Wveimar, I was using a RadGrid within a RadDockLayout/RadDockZones/RadDock.  For the life of me, I could not get the Update/Insert Commands to fire for this RadGrid within thr RadDock.  I tried testing the same exact RadGrid example but this time placing it outside of the RadDock and it worked fine, the events were being fired

    After a few hours of pulling my hair out, I realized that I had the following two attributes set in my RadDockLayout which were the source of the problem.  Once I removed the attributes, the Update/Insert Commands were firing.




  9. Neerav
    Neerav avatar
    50 posts
    Member since:
    Nov 2010

    Posted 02 Dec 2010 Link to this post

    Dear Telerik staff,
    I have a empty "RadGrid1" and hyper links "A","ALL"...  on default.aspx page.
     On click of "ALL" I have opened a new window pop up using  "RadWindow" with radopen = ("default.aspx", radwindowID) method. This will pop up the window on same(default.aspx) page. Now this radwindow is defined on default.aspx page with a another radgrid "radgrid2" in it using content template tags of radwindow. The radgrid2 also has a template column with command = "move to selected" which on click will move the corresponding row from radgrid2 to radgrid1 and hide that row in radgrid2. This process can fill up radgrid1(which was empty). The radgrid2 has "onitemcommand  = "radgrid1_itemcommand"" property set to handle click event from template column (command name = "move to selected"), this property  has logic for hiding row in radgrid2 and moving row to radgrid1.

    Now I have been able to open the window on same page with radgrid2 in it with template column "+" in it.
    The page get loads and all GUI gets displayed properly along with radgrid1 and links. WHen I click "ALL" the radwindow gets pop up with data filled radgrid2 with template column "+" in it.
     The problem is, when I click "+" i.e. template column for first time the "radgrid1_itemcommand" method does not get fired. But from second click onwards the command gets fired and all workds well (i.e. rows get move to radgrid1 from radgrid2).
    On click of template column the radgrid1_itemcommand does not gets fired for first time and because of that, the row does not get move from radgrid2 to radgrid1  only for first time. BUt ll works on and after second click on template column.

    PFA the images of my current scenario where "Radgrid_image1" is image where I click on "+" for first time and nothing happens and "radgrid_image2" is image where the row moves to radgrid1 and get hidden in radgrid2.

     Ihave used following


    <telerik:RadAjaxManager runat="server" ID="radAjax" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <telerik:AjaxSetting AjaxControlID="RadGrid2">
    <telerik:AjaxUpdatedControl ControlID="RadGrid2"/>
    <telerik:AjaxUpdatedControl ControlID="RadGridfirst" />


    Important thing that when I comment the above ajax setting code, all start to work well even for firts time i.e. rows gets shifted from from first click on template column. But this process closes the radwindow every time the template column getsclicked, so I have to click "ALL" again for opning the radwindow which is not at all my requirement.

    Kindly reply

    Thanks and Regards


  10. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 07 Dec 2010 Link to this post

    Hi Neerav,

    Please test the suggestion provided in the official support ticket opened for this issue.

    Kind regards,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
DevCraft R3 2016 release webinar banner