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

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

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ingemar
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">
    <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!

1 Answer, 1 is accepted

Sort by
0
Eyup
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:
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.
Tags
Grid
Asked by
Ingemar
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or