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

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

1 Answer 165 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Ingemar asked on 09 Feb 2017, 09:01 AM

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">
      <telerik:GridEditCommandColumn HeaderStyle-Width="30px" EditImageUrl="pen-16x16.png" ButtonType="ImageButton" UniqueName="TemplateColumn"/>

(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.


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 13 Feb 2017, 01:36 PM
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:

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.

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.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question