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

OnImageEditing Not Firing

2 Answers 49 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Nelbin
Top achievements
Rank 1
Nelbin asked on 14 Aug 2013, 08:15 AM
I have put this in my ascx file and I already have a ImageEditorTool with
the command name CustomPrint. But it seems that it isn't firing in the codebehind.
 I tried it using breakpoint and still it isn't firing. Any help?

The other tools(not custom) are working. I am also making this under vb.net coding
      <telerik:RadImageEditor ID="CurrentPageImage" runat="server" Height="100%" Width="100%" OnImageEditing="CurrentPageImage_ImageEditing">
        
                    <Tools>
                    
                     <telerik:ImageEditorToolGroup>
                      <telerik:ImageEditorTool CommandName="Rotate" ToolTip="Rotate Image" IsToggleButton="true">
                     </telerik:ImageEditorTool>
                       
                    <telerik:ImageEditorTool CommandName="RotateRight" ToolTip="Rotate Right by 90 degrees">
                 </telerik:ImageEditorTool>
                    <telerik:ImageEditorTool CommandName="RotateLeft" ToolTip="Rotate Left by 90 degrees">
                    </telerik:ImageEditorTool>
                    <telerik:ImageEditorTool CommandName="Flip" ToolTip="Flip Image" IsToggleButton="true">
                </telerik:ImageEditorTool>
 
                <telerik:ImageEditorTool CommandName="FlipVertical" ToolTip="Flip Image Vertically">
                </telerik:ImageEditorTool>
                <telerik:ImageEditorTool CommandName="FlipHorizontal" ToolTip="Flip Image Horizontally">
                </telerik:ImageEditorTool>
                   <telerik:ImageEditorTool CommandName="Zoom" ToolTip="Zoom Image" IsToggleButton="true">
                </telerik:ImageEditorTool>
        <telerik:ImageEditorTool CommandName="ZoomIn" ToolTip="Zoom In">
                </telerik:ImageEditorTool>
                      <telerik:ImageEditorTool CommandName="ZoomOut" ToolTip="Zoom Out">
                </telerik:ImageEditorTool>
                  <telerik:ImageEditorTool CommandName="CustomPrint" ToolTip="Print" ImageUrl="~/Images/PDFViewer/pdf-view-12-print.png" >
                </telerik:ImageEditorTool>
        </telerik:ImageEditorToolGroup>
    </Tools>
                        </telerik:RadImageEditor>
<
script type="text/javascript">
                              Telerik.Web.UI.ImageEditor.CommandList.CustomPrint = function (imageEditor, commandName, args) {
 
                                  var commandText = "CustomPrint";
                                  var commandArgument = "Additional Argument Sent to the Server";
                                  
                                  imageEditor.editImageOnServer(commandName, commandText, commandArgument, callbackFunction)
                               
                              }
 
                              function callbackFunction(clientData, serveData) {
                              }
    </script>

2 Answers, 1 is accepted

Sort by
0
Nelbin
Top achievements
Rank 1
answered on 15 Aug 2013, 03:40 AM
I think I have solved my problem but any second opinions? I just set the canvas mode to no. I am not sure if there are going to be downside effects on my solution. Thanks
0
Vessy
Telerik team
answered on 19 Aug 2013, 06:42 AM
Hello Nelbin,

As you have assumed, setting the CanvasMode="No" is the solution of the issue. The reason for that is that when the ImageEditor is used in enabled CanvasMode all changes are made on the Client, and so the ImageEditing event is not fired.

The only downside effects that you will meet is that your users will not be able to use all of the CanvasSupported features of the control (like filtering and drawing), but currently this is the only way to implement a custom Server command.

Kind regards,
Veselina Raykova
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ImageEditor
Asked by
Nelbin
Top achievements
Rank 1
Answers by
Nelbin
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or