Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
149 views
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadFile.aspx.cs" Inherits="NewBusiness.UploadFile" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .rieDialogs
        {
            z-index: 10000;
        }
        #modalPopup_C
        {
            overflow:hidden !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server"></telerik:RadSkinManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script>
                var dialog;
                var uploadedFilesCount = 0;

                function OnClientFileUploaded(sender, eventArgs) {
                    uploadedFilesCount++;
                }

                function validateRadAsyncUpload(source, e) {
                    if (uploadedFilesCount > 0)
                        e.IsValid = true;
                    else
                        e.IsValid = false;
                }

                function showImageEditor() {
                    dialog = $find("<%= RwImageEditor.ClientID %>");
                    if (dialog) {
                        dialog.show();
                    }
                    else
                        radalert("Unable to locate image editor window.", 330, 110, "Debug");
                }

                //Callback function for the custom save button in the ImageEditor
                function closeImageEditor(clientData, serverData) {
                    if (dialog)
                        dialog.close();
                    else
                        radalert("Unable to locate image editor window.", 330, 110, "Debug");
                }

                //Automatically resize image to 100 x 100 if it is cropped
                function imgEditorImageChanged(imgEditor, args) {
                    setTimeout(function () {
                        if (args.get_commandName() == "Crop")
                            imgEditor.resizeImage(100, 100, true);
                    }, 500);
                }

                //Create a custom save command for the image editor
                Telerik.Web.UI.ImageEditor.CommandList.SavePicture = function (imageEditor, commandName, args) {
                    imageEditor.saveImageOnServer("Picture", true);
                    closeImageEditor();
                }

            </script>
        </telerik:RadScriptBlock>
        <table>
            <tr>
                <td>
                    <telerik:RadAsyncUpload runat="server" ID="RauPicture"
                        OnClientFileUploaded="OnClientFileUploaded" OnFileUploaded="RauPicture_FileUploaded"
                        AllowedFileExtensions="jpg,jpeg,png,gif" MaxFileSize="1048576" Width="250px">
                    </telerik:RadAsyncUpload>
                    <asp:Button ID="BtnUpload" Text="Upload Image" runat="server"
                        CausesValidation="False" Width="229px" OnClientClick="showImageEditor()">
                    </asp:Button>
                </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadTextBox ID="TextBox1" runat="server" CausesValidation="True" Visible="false"
                            AutoAdjustImageControlSize="false" Height="80px" Width="80px" >
                    </telerik:RadTextBox>
                        <asp:CustomValidator ID="CvRauPicture" runat="server" ErrorMessage="Please select a picture." ControlToValidate="TextBox1" ClientValidationFunction="validateRadAsyncUpload" CssClass="errors" Text="ç"></asp:CustomValidator>    
                </td>
            </tr>
        </table>
        <telerik:RadAjaxPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" EnableAJAX="true">
            <telerik:RadWindow ID="RwImageEditor" runat="server" Animation="Fade"
                AutoSize="True" Modal="False" VisibleStatusbar="False" Title="Edit Photo" EnableViewState="false" ShowContentDuringLoad="true" VisibleOnPageLoad="false">
                <ContentTemplate>
                    <telerik:RadImageEditor ID="RadImageEditor1" runat="server" OnImageLoading="RadImageEditor1_ImageLoading"
                        OnClientImageChanged="imgEditorImageChanged">
                        <Tools>
                            <telerik:ImageEditorToolGroup>
                                <telerik:ImageEditorTool CommandName="SavePicture" />
                                <telerik:ImageEditorToolSeparator />
                                <telerik:ImageEditorToolStrip CommandName="Undo" />
                                <telerik:ImageEditorToolStrip CommandName="Redo" />
                                <telerik:ImageEditorToolStrip CommandName="Reset" />
                                <telerik:ImageEditorToolSeparator />
                                <telerik:ImageEditorTool CommandName="Crop" />
                                <telerik:ImageEditorTool CommandName="Resize" />
                            </telerik:ImageEditorToolGroup>
                        </Tools>
                    </telerik:RadImageEditor>
                </ContentTemplate>
            </telerik:RadWindow>
        </telerik:RadAjaxPanel>
    </form>
</body>
</html>





Raeshawn
Top achievements
Rank 1
 answered on 26 Aug 2014
2 answers
174 views
I'm trying to export an HTML table from RadEditor and the text is getting jumbled up. I can reproduce this by pasting the code below into the RadEditor Export to PDF demo. What am I doing wrong?
​
<table height="180" style="width: 720px;" border="1">
    <colgroup><col /></colgroup>
    <tbody>
        <tr>
            <td>
            <p style="text-align: center;"><span style="font-family: Arial; font-size: 48px;">Your Name Here<br />
            (555) 555-5555</span></p>
            </td>
        </tr>
    </tbody>
</table>
Ianko
Telerik team
 answered on 26 Aug 2014
3 answers
86 views
hi i am new to telerik .
my first question is this open source and paid tool.
if it is an open source where i can download this telerik components to visual studio 2005.

Pavlina
Telerik team
 answered on 26 Aug 2014
2 answers
112 views
If you print a page that has a RadButton with an icon on it, the icon doesn't print.  This behavior can be seen on the demo page: http://demos.telerik.com/aspnet-ajax/button/examples/overview/defaultcs.aspx

Also, this occurs with the RadSlider as well.

Any tips for getting these to print?

Thanks!
Gaurab
Top achievements
Rank 1
 answered on 26 Aug 2014
3 answers
505 views
We are using RadGrid with Entity Data Sources.  I'd like to be able to set the MaxLength of the text boxes in edit mode based on the size of the field in the database.  If a database column is varchar(10), then I'd like to set the MaxLength = 10.  Is there an easy way to do this?  I've got some ideas about going to the data source and pulling the column information but I'm wondering if that information is already somewhere in the grid object since it was bound to the entity object.

Any ideas / thoughts would be appreciated.
Angel Petrov
Telerik team
 answered on 26 Aug 2014
5 answers
226 views
I have just recently upgraded from Q3 2011 to Q1 2014 of RadControls and some client side code has stopped working.  What I have are 3 RadSlidingZones within a RadSplitter/RadPane.  What I'm trying to do is disable the first RadSlidingzone "slPane1" by default in JavaScript at the bottom of the page.  This code used to work before the upgrade.  I'm also using IE11, .Net Framework 4.5, & VS2012.  Please advise.

Thanks,
Rob

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestRadSlidingZone.aspx.vb" Inherits="TestRadSlidingZone" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                <asp:ScriptReference Path="~/Script/jQuery/jquery-ui-1.8.17.custom.min.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <div>
            <telerik:RadSplitter ID="RadSplitter1" runat="server">
                <telerik:RadPane runat="server" ID="pNav" Height="100%">
                    <div id="DivSLZone" runat="server" style="float: left; clear: none; width: 22px; height: 100%;">
                        <telerik:RadSlidingZone ID="slZone" runat="server" SlideDirection="Right" ClickToOpen="true" Width="22">
                            <telerik:RadSlidingPane ID="slPane1" Title="sPane 1" runat="server" Width="275"
                                EnableDock="false" Height="100%">
                                <div runat="server" id="divSlPane1">
                                </div>
                            </telerik:RadSlidingPane>
                            <telerik:RadSlidingPane ID="slPane2" Title="sPane 2" runat="server" Width="275"
                                EnableDock="false" Height="100%">
                                <div runat="server" id="divSlPane2">
                                </div>
                            </telerik:RadSlidingPane>
                            <telerik:RadSlidingPane ID="slPane3" Title="sPane 3" runat="server" Width="275"
                                EnableDock="false" Height="100%">
                                <div runat="server" id="divSlPane3">
                                </div>
                            </telerik:RadSlidingPane>
                        </telerik:RadSlidingZone>
                    </div>
                    <div style="height: 100%;">
                        <asp:PlaceHolder runat="server" ID="phLeft" />
                    </div>
                </telerik:RadPane>
                <telerik:RadSplitBar runat="server" ID="sBar1" CollapseMode="Forward" EnableResize="true" />
                <telerik:RadPane runat="server" ID="pContent" Scrolling="none" BackColor="white">
                </telerik:RadPane>
            </telerik:RadSplitter>
        </div>
    </form>
</body>
</html>
<telerik:RadCodeBlock runat="server" ID="rcb">
    <script type="text/javascript">
        $(document).ready(function () {
            var pnl = $find('<%= slPane1.ClientID%>');
            if (pnl != null)
                pnl._tabContainer.disabled = true;
        });
    </script>
</telerik:RadCodeBlock>

Partial Class TestRadSlidingZone
    Inherits System.Web.UI.Page
 
End Class

Rob
Top achievements
Rank 1
 answered on 26 Aug 2014
8 answers
173 views
Currently If you are saving the image as en EmbeddedPNG the text will not show in the image.  I was told back in march this was scheduled to be fixed in the next release ( I assume that means the Q2 release),  Is this feature/fix still planned for the Q2 release?
Pavlina
Telerik team
 answered on 26 Aug 2014
1 answer
128 views
I have disable the EnableEmbeddedScripts for all controls in page and included the javascript file in RadScriptManger so that i can increase the performance but i am getting a java script error as shown in attached file.

Kindly let me know the reason why this error is coming and how can i resolve it
Hristo Valyavicharski
Telerik team
 answered on 26 Aug 2014
2 answers
1.6K+ views
        RadListBoxDataType.DataTextField = "Value.DisplayName";
        RadListBoxDataType.DataValueField = "Key";
        RadListBoxDataType.DataSource = dataTypeList;
        RadListBoxDataType.DataBind();

The above does not work.  What I want to know is it possible to bind to a property of "Value" where "Value" is an object.

Chris
Top achievements
Rank 1
 answered on 26 Aug 2014
1 answer
228 views

I'm working with the Q2 2014 version of the Editor and I'm using the shortcut attribute in the tools XML file to define various keyboard shortcuts.

I've changed some of the shortcut keys and the Editor is still responding to the default shortcuts.  For example, originally the shortcut for the Link Manager was CTRL+K.  I want it to be CTRL+L but it still responds to CTRL+K.

Secondly, since I'm using Iframe as the ContentAreaMode because of CSS Styling, I've found that unless the focus is on the Iframe, the keyboard shortcuts don't work at all.  How can I get it to work properly on the surrounding areas too?  This is important for functions like Save and other custom menu options (Page Properties, etc) along with items like the Image Manager or Document Manager.

Editor Code:

<telerik:RadEditor ID="reContent" runat="server" ExternalDialogsPath="~/RadEditorDialogs/" ToolsFile="tools.xml" ContentAreaMode="Iframe"
                ContentFilters="MakeUrlsAbsolute, DefaultFilters" EditModes="Design, Html" EnableAriaSupport="True" Skin="Metro" ToolbarMode="RibbonBar" OnClientLoad="onClientLoad" EnableViewState="False">
                <Content></Content>
                <ImageManager ViewPaths="/images" UploadPaths="/images" DeletePaths="/images" MaxUploadFileSize="2100000" ContentProviderTypeName="niagarafalls.DBContentProvider, niagarafalls"
                    SearchPatterns="*.gif, *.png, *.jpg, *.svg, *.svgz" ViewMode="Grid"
                    AllowMultipleSelection="True" EnableAsyncUpload="True" EnableImageEditor="False" EnableThumbnailLinking="False" />
            </telerik:RadEditor>

Tools.xml snippet:
<tools name="Page" tab="Home">
    <tool name="Save" shortcut="CTRL+S"/>
    <tool name="Page Properties" shortcut="CTRL+R"/>
    <tool name="New Page" shortcut="CTRL+N"/>
    <tool name="Open Page" shortcut="CTRL+O"/>
  </tools>
<tools name="Links" tab="Insert">
        <tool name="LinkManager" size="large" shortcut="CTRL+L"/>
        <tool name="Unlink" strip="LinksStrip" shortcut="CTRL+SHIFT+L"/>
        <tool name="DocumentManager" strip="LinksStrip"/>
        <tool name="ImageMapDialog" strip="LinksStrip"/>
        <tool name="InsertCustomLink" shortcut="CTRL+ALT+K"/>
    </tools>


Thanks,
Shawn

Ianko
Telerik team
 answered on 26 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?