Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
129 views
HI
I have an image cropping issue in telerik image editor.
An script error occurs when Crop button click in Dialog Box.
And cropping does not work.
It only resize the image.

I doesn't use session at image editing and loading.

dll file version : 2013.2.611.35

<< aspx page >>
-------------------------------------------------------------------------------------------------

<telerik:RadImageEditor runat="server" ID="RadImageEditor1" Visible="false" OnImageEditing="RadImageEditor1_ImageEditing" CanvasMode="No" OnImageLoading="RadImageEditor1_ImageLoading" ShowAjaxLoadingPanel="true" ImageCacheStorageLocation="Session">
  <Tools>
   <telerik:ImageEditorToolGroup>
                <telerik:ImageEditorTool CommandName="Save" Text="Image Apply"/>
       <telerik:ImageEditorToolSeparator />
       <telerik:ImageEditorToolStrip CommandName="Reset" Text="Reset" />
       <telerik:ImageEditorToolStrip CommandName="Undo" Text="Undo" />
       <telerik:ImageEditorToolStrip CommandName="Redo" Text="Redo" />
       <telerik:ImageEditorToolSeparator />
       <telerik:ImageEditorTool CommandName="Crop" />
       <telerik:ImageEditorTool CommandName="Resize" />
       <telerik:ImageEditorTool CommandName="Zoom" />
       <telerik:ImageEditorTool CommandName="ZoomIn" />
       <telerik:ImageEditorTool CommandName="ZoomOut" />
       <telerik:ImageEditorTool CommandName="Opacity" />
       <telerik:ImageEditorTool CommandName="Rotate" />
       <telerik:ImageEditorTool CommandName="RotateRight" />
       <telerik:ImageEditorTool CommandName="RotateLeft" />
       <telerik:ImageEditorTool CommandName="Flip" />
       <telerik:ImageEditorTool CommandName="FlipVertical" />
       <telerik:ImageEditorTool CommandName="FlipHorizontal" />
       <telerik:ImageEditorTool CommandName="AddText" />
   </telerik:ImageEditorToolGroup>
  </Tools>    
     </telerik:RadImageEditor>

-------------------------------------------------------------------------------------------------


<< aspx.cs page >>
path  ex )   D:\dpimage\temp\editor\2013\10\31\14\428606850_20131031144126.jpg
-------------------------------------------------------------------------------------------------

protected void RadImageEditor1_ImageLoading(object sender, ImageEditorLoadingEventArgs args)
        {
            args.Image = new EditableImage(path);
            args.Cancel = true;
        }

protected void RadImageEditor1_ImageEditing(object sender, ImageEditorEditingEventArgs args)
        {
            args.Cancel = true;

            try
            {
                string d = DateTime.Now.ToString("yyyy-MM-dd-HH").Replace("-", "\\");
                path = imagePath(source);

                var thumbImage = args.Image.Clone();

                var ms = new MemoryStream();
                thumbImage.Image.Save(ms, thumbImage.RawFormat);

                File.WriteAllBytes(path, (byte[])ms.ToArray());

                result_url = path.Replace(RootPath, dpimage_url).Replace("\\", "/");

                args.Argument = "OK," + result_url;
            }
            catch (Exception ex)
            {
                args.Argument = ex.Message + ", ";
                throw ex;
            }
        }
-------------------------------------------------------------------------------------------------

Arron
Top achievements
Rank 1
 answered on 12 Dec 2013
5 answers
156 views
Hi,
i am having grid in which i am doing delete ,
for first record delete its working fine but for second time it is not getting the id of hide column,
so where do i hide column
my code is
protected void RadGrid1_PreRender(object sender, EventArgs e)
   {
       RadGrid1.MasterTableView.GetColumn("UserId").Visible = false;
       RadGrid1.MasterTableView.GetColumn("EntityId").Visible = false;
   }
 
 
protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
   {
       GridEditableItem DeleteEmployee = e.Item as GridEditableItem;
       Hashtable NewValues = new Hashtable();
       e.Item.OwnerTableView.ExtractValuesFromItem(NewValues, DeleteEmployee);
       int EntityId = Convert.ToInt32(DeleteEmployee.GetDataKeyValue("EntityId"));
       int UserId = Convert.ToInt32(NewValues["UserId"].ToString());
       ObjGlobas.DeleteEmployeePermission(UserId,EntityId);
       RadGrid1.Rebind();
       RadWindowManager1.RadAlert("Employee Permission Deleted Successfully!", 325, 200, "Manifest-BI : DELETE", null);
 
   }
Thanks
Shinu
Top achievements
Rank 2
 answered on 12 Dec 2013
3 answers
141 views
Hello....
my name is sondang, i am a newbie in Telerik.
Can the master told me to make CRUD(Creat, Update, Delete) by Telerik.
I might along with examples of its programs.

Thank you


Princy
Top achievements
Rank 2
 answered on 12 Dec 2013
1 answer
101 views

Below is my sample code where the first menu on click is not redirecting,

<telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true"
        ClickToOpen="true">
        <Items>
            <telerik:RadMenuItem>
                <ItemTemplate>
                    <a class="rmLink" href="http://www.google.com"><span class="rmText">This is the root item</span></a>
                </ItemTemplate>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="Edit" AccessKey="E">
                <Items>
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/21undo.gif" Text="Undo" AccessKey="U" />
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/cut.png" Text="Cut" AccessKey="T" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/copy.png" Text="Copy" AccessKey="C" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/paste.png" Text="Paste" AccessKey="P" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/23clipboard.gif" Text="Clipboard..."
                        AccessKey="b" />
                    <telerik:RadMenuItem IsSeparator="True" />
                </Items>
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>
Tried my best but didn't find any solution. 

Anyone have solution ? Looking for help !

Thanks,
Stalin

Princy
Top achievements
Rank 2
 answered on 12 Dec 2013
1 answer
126 views

I don't understand why this works:



$find("<%=MyDate.ClientID%>").set_selectedDate('Tue Dec 3 00:00:00 PST 2013');


But, this doesn't:

$find("<%=MyDate.ClientID%>").set_selectedDate('12/3/2013');




Shinu
Top achievements
Rank 2
 answered on 12 Dec 2013
5 answers
182 views
I'm struggling to get a working version of the checkbox filter process.  I write in VB.net.
I have created a web service asmx file but the code in it is never executed.  The code stops in the Javascript with a null object.  Specifically "d" and "f" in the following code blocks are null.
Additonally, the asmx file cannot be referenced by a project as the RadListBoxItemData is a dictionary object which is not supported. This would prevent the service file being part of a services project (my prefered design).

Do you have a working example project written in VB that I could view?

this._filterCancelButton=$telerik.getElementByClassName(this._filterMenu.get_element(),"rgFilterCancel");
this._checkListFilterCancelButtonDelegate=$telerik.addMobileHandler(this,this._filterCancelButton,"click",this._checkListFilterCancelButtonHandler);
}}if(this._checkListFilterKeys&&this._checkListFilterKeys.length>0){this.updateClientState();
}if(this._filterCheckListClientID){var d=$find(this._filterCheckListClientID);
this._checkListItemsRequestedDelegate=Function.createDelegate(this,this._checkListItemsRequestedHandler);
 
d.add_itemsRequested(this._checkListItemsRequestedDelegate);
 
d.add_itemChecked(Function.createDelegate(this,function(m,l){if(m.selectAllFlag){return;
}m.selectAllFlag=true;
if(l.get_item().get_text()=="(Select All)"){if(l.get_item().get_checked()){m.get_items().forEach(function(n){n.check();
});
if(this._filterCheckListClientID){var f=$find(this._filterCheckListClientID);
this._checkListFilterActiveColumn=a;
 
f.get_items().clear();
 
if(a._owner._data.CheckListWebServicePath&&a._data.FilterCheckListWebServiceMethod){f.set_visible(true);
f.get_webServiceSettings().set_path(a._owner._data.CheckListWebServicePath);
f.get_webServiceSettings().set_method(a._data.FilterCheckListWebServiceMethod);
Joan
Top achievements
Rank 1
 answered on 11 Dec 2013
4 answers
182 views
Hello,

I have problem in border width in RadScheduler. I set the color as well as width below in AppointmentDataBound event:

e.Appointment.BorderColor = System.Drawing.Color.FromName(e.Appointment.Attributes["VisitTypeColorName"].ToString());
                e.Appointment.BorderStyle = BorderStyle.Solid;
                e.Appointment.BorderWidth = Unit.Pixel(10);

But appointment border width is still small. And this e.Appointment.Attributes["VisitTypeColorName"].ToString() is come from the database. It get the color from the database.
I am attach the file and mark the appointment in image which border color show.

Please help me as soon as possible.
Thanks.

Jiten Mutum
Sean
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
847 views
I need to run some javascript code every time on page load, after Telerik Ajax controls are rendered on client. I tried to use this code:
Sys.Application.add_load(SetFocusToField);

function SetFocusToField() {
 
    if (indexToFocus == 0 && controlToFocus) {
        controlToFocus.focus();
        indexToFocus++;
    }
}
It works fine for the first time (regular page load) but on a partial postback this code doesn't run. I understand why it doesn't work but how can I call this javascript function on partial postbacks?

I tried to use RegisterStartupScript but it doesn't work for me too :(

string scriptFocus = @"
     
    ResetIndexOnFocus = 0;
    SetFocusToField();
 
";
ScriptManager.RegisterStartupScript(this, this.GetType(), "scriptFocus", scriptFocus, true);


Thank you in advance!
msigman
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
110 views
Can't add text inside Radeditor (Design) in IE 9, 10 after re-appending radedtior to a new div 

Scenario to reproduce:

 <div id="prev"><telerik:RadEditor ID="RadEditor1" runat="server" ></telerik:RadEditor></div>
        
 <div style="height:200px;">some text...</div>

 <div id="next"></div>

 <div id="btn">click</div>

  <script type="text/javascript">
        $(function () {
            $("#btn").click(function(){
                $("#next").append($("#prev"));
            });
        });
    </script>



1. After clicking on "click" (button), the div (id="prev") which contains the editor is being append to div (id="next") (according to jquery script).
2. It's impossible to add text inside the editor (Design) in IE 9,10 (it works fine in chrome).
Ianko
Telerik team
 answered on 11 Dec 2013
4 answers
292 views
Hi,
We are writing a new version of our software using C# and Telerik tools.  In this case we have HTML content stored in the database that is being migrated and read into a RadEditor.  The issue seems to be when the content was created as a HTML Table.  Is there   An example is below:

<TABLE style="WIDTH: 503pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=670 border=0 x:str>
<COLGROUP>
<COL style="WIDTH: 34pt; mso-width-source: userset; mso-width-alt: 1645" width=45>
<COL style="WIDTH: 469pt; mso-width-source: userset; mso-width-alt: 22857" width=625>
<TBODY>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl26 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; WIDTH: 503pt; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" width=670 colSpan=2 height=17><STRONG><FONT face=Arial size=2>Roof Inspection, 1 
  
Year:</FONT></STRONG></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl25 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent" height=17><STRONG><FONT face=Arial size=2></FONT></STRONG></TD>
<TD class=xl24 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; BACKGROUND-COLOR: 
  
transparent"><STRONG><FONT face=Arial size=2></FONT></STRONG></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl25 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent" height=17><STRONG><FONT face=Arial size=2></FONT></STRONG></TD>
<TD class=xl24 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; BACKGROUND-COLOR: 
  
transparent"><STRONG><FONT face=Arial size=2></FONT></STRONG></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>Note: Use caution whenever working on a 
  
roof.<SPAN style="mso-spacerun: yes">  </SPAN>Ensure all fall arrest procedures are followed.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl25 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent" height=17><FONT face=Arial size=2></FONT></TD>
<TD class=xl24 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; BACKGROUND-COLOR: 
  
transparent"><FONT face=Arial size=2></FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent" height=17 x:str="( ) "><FONT size=2><FONT face=Arial>( )<SPAN style="mso-spacerun: 
  
yes"> </SPAN></FONT></FONT></TD>
<TD class=xl24 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; BACKGROUND-COLOR: 
  
transparent"><FONT face=Arial size=2>Ensure the roof area is clean and free of debris, nails, scraps of metal and plant growth on the 
  
roof.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17 x:str="( ) Examine metal flashings, cappings, and metal siding for 
  
wind damage, corrosion, loose "><FONT size=2><FONT face=Arial>( ) Examine metal flashings, cappings, and metal siding for wind damage, 
  
corrosion, loose<SPAN style="mso-spacerun: yes"> </SPAN></FONT></FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>joints or defective caulking.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Check pitch pockets and machinery bases 
  
for damage.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Examine roof surface for deterioration, 
  
water infiltration, or cracking.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Check that all roof drains are 
  
clear.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Check for poor drainage.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Check all roof anchors.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Check parapets for open mortar joints, 
  
capping.</FONT></TD></TR>
<TR style="HEIGHT: 12.75pt" height=17>
<TD class=xl27 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: #c0c0c0; BORDER-BOTTOM: #c0c0c0; HEIGHT: 12.75pt; 
  
BACKGROUND-COLOR: transparent; mso-ignore: colspan" colSpan=2 height=17><FONT face=Arial size=2>( ) Check all skylights for cracks, damaged 
  
flashing or caulking.</FONT></TD></TR></TBODY></TABLE>

When this is put into a htm file, it looks fine, but in the editor it looks like the attached Roof Inspection.jpg file.

The Editor (leaving out Tools and Modules) is defined as below:

<telerik:RadEditor ID="DescriptionEditor" Runat="server" 
                    Width="650px" Height="355px"
                    EditModes="Design, Preview"
                    EnableResize="false"
                    StripFormattingOnPaste="All" 
                    SkinID="DefaultSetOfTools"
                    OnClientCommandExecuting="OnClientCommandExecuting" 
                    >

Thanks for your help,
Dan Norton
Marin Bratanov
Telerik team
 answered on 11 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?