telerik:GridEditCommandColumn does not fire OnEditCommand if ButtonType=“ImageButton”?

2 posts, 0 answers
  1. Ingemar
    Ingemar avatar
    29 posts
    Member since:
    Apr 2012

    Posted 09 Feb 2017 Link to this post

    In a telerik:RadGrid, I have a GridEditCommandColumn like this:

     

    <telerik:RadGrid ID="grdMembers" runat="server" OnEditCommand="grdMembers_OnEditCommand" AutoGenerateColumns="False">
      <MasterTableView DataKeyNames="MemberID" ShowHeadersWhenNoRecords="false">
        <Columns>
          <telerik:GridEditCommandColumn HeaderStyle-Width="30px" EditImageUrl="pen-16x16.png" ButtonType="ImageButton" UniqueName="TemplateColumn"/>
        </Columns>
      </MasterTableView>
    </telerik:RadGrid>

    (some more columns are actually included, but I omit those for now).

    The grdMembers_OnEditCommand is having a breakpoint.
    Now, when the ButtonType is either ImageButton or FontIconButton, the pen icon shows up (not otherwise), but the OnEditCommand will not fire.

    Why not?

    If the ButtonType is LinkButton, the first column will read "Edit", and the OnEditCommand fires if such a link is clicked.

    It would help if I could paste code in this forum without line endings being killed.

    Also, undo would be appreciated.

    Thanks!

  2. Eyup
    Admin
    Eyup avatar
    3841 posts

    Posted 13 Feb 2017 Link to this post

    Hello Ingemar,

    I've created a sample RadGrid web site to demonstrate that this column definition should work as expected. Please run the attached web site sample and verify the result.

    It should work regardless whether the RenderMode of the grid is set to Lightweight or not:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/mobile-support/render-modes#setting-render-mode

    Generally, when developing your app, we highly recommend you to ensure that the functionality works without adding AJAX. Please temporarily disable any AJAX on the page if present (RadAjaxManager, RadAjaxPanel, UpdatePanel, etc.) and enable your script debugger (FireBug or F12) to see whether there are any script or server errors interfering, and make sure that the application works without AJAX.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top