Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
71 views
hi
i use Editor in my Pages and get the error 'Control with type 'Telerik.Web.UI.RadEditor' cannot be handled by layout'
is there some one to help me to Resolve this problem???
Ianko
Telerik team
 answered on 13 Feb 2014
2 answers
29 views
Hi
i want to display the pager like pages 1 to 10 of 1. How ?
Shinu
Top achievements
Rank 2
 answered on 13 Feb 2014
4 answers
159 views
Okay, if I dynamically created a RadAjaxManager in a page's code-behind everything works fine.  I followed the same technique as: http://www.telerik.com/community/forums/aspnet-ajax/ajax/nullreferenceexception-in-radajaxmanager-ajaxsettings-addajaxsetting.aspx

Then, I wanted to dynamically create the RadAjaxManager in a server control.  So I added:
        #region private properties  
          
        private RadAjaxManager _radAjaxManager = null;
        #endregion  
 
        protected override void OnInit(EventArgs e)  
        {  
            RadScriptManager scriptManager = new RadScriptManager();   
            Controls.Add(scriptManager);  
              
            RadAjaxManager radAjaxManager = new RadAjaxManager();  
            radAjaxManager.ID = "radAjaxManager";  
            _radAjaxManager = radAjaxManager;  
            Controls.Add(radAjaxManager);  
              
            base.OnInit(e);   
 
            scriptManager.Scripts.Add(new ScriptReference("Elevate.UI.Scripts.Search.js""Elevate"));  
        }  
 
        protected override void CreateChildControls()  
        {  
            RadAjaxLoadingPanel radAjaxLoadingPanel = new RadAjaxLoadingPanel();  
            radAjaxLoadingPanel.ID = "ajaxLoadingPanel";  
            radAjaxLoadingPanel.Skin = "Default";  
            Controls.Add(radAjaxLoadingPanel);  
 
            /* Child Controls Creation */ 
 
            _radAjaxManager.AjaxSettings.AddAjaxSetting(button1, simplePanel, radAjaxLoadingPanel);  
            _radAjaxManager.AjaxSettings.AddAjaxSetting(linkButton1, simplePanel, radAjaxLoadingPanel);  
            _radAjaxManager.AjaxSettings.AddAjaxSetting(lbMLS, simplePanel, radAjaxLoadingPanel);  
        } 

As you can imagine, I get the dreaded NullReferenceException. 

Obviously, I don't want to require the end-user to add a RadAjaxManager to the page manually or in the parent page's OnInit.  I want the control to be self-contained (i.e. adding the RadAjaxManager only when needed for the control).

How do I do this?

Thanks,
Joshua
Maria Ilieva
Telerik team
 answered on 13 Feb 2014
2 answers
103 views
Hi

When attempting to add a Navigator to a chart with two stacked Column series, the Area series in the Navigator looks to have the correct values in it, but no Range Selector is visible. Using the mouse scroll wheel when hovering over the Area series appears to change the range of the main chart, but still no Range Selector is visible.

Are there any known issues using Navigator with Column series rather than Candlestick?

Regards
Jamie
Danail Vasilev
Telerik team
 answered on 13 Feb 2014
1 answer
231 views
Hi,

I'm trying to save a cropped image, it seems to crop in the browser, but when I try to save that image, it saves the original.... I've tried to the the apply changes method, or calling editImageOnServer, but I'm not getting anywhere. It seems that if I just call the saveImageOnServer method in my javascript, it calls the image load function again, and reloads the original image, which means that when the ImageSaving function is called, it also uses the original image.

Help!!!!  I've put some of my code snippets below - I can't see a way to get to save the changes to the image, or to pass the arguments into the ImageEditing function on the server, which never seems to get called

<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
 
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
  
    <div style="margin-bottom: 25px;">
        <asp:Label ID="lblError" runat="server" EnableViewState="false" Style="color: Red; font-size: 16px;" /><br />
    </div>
 
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
            function OnClientFilesUploaded(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest();
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadImageEditor1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div id="dwndWrapper">
        <telerik:RadAsyncUpload ID="AsyncUpload1" runat="server"
            OnClientFilesUploaded="OnClientFilesUploaded" OnFileUploaded="AsyncUpload1_FileUploaded"
            MaxFileSize="2097152" AllowedFileExtensions="jpg,png,gif,bmp"
            AutoAddFileInputs="false" Localization-Select="Upload Image" />
        <asp:Label ID="Label1" Text="*Size limit: 2MB" runat="server" Style="font-size: 10px;"></asp:Label>
    </div>
    <telerik:RadImageEditor ID="RadImageEditor1" runat="server" OnImageLoading="RadImageEditor1_ImageLoading"
        Width="300px" Height="300px" ExternalDialogsPath="~/user" ToolsFile="~/user/tools.xml"
        OnImageSaving="RadImageEditor1_ImageSaving"
        OnClientCommandExecuting="modifyCommand" CanvasMode="No">
        
    </telerik:RadImageEditor>
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="Scripts" runat="server">
    <telerik:RadCodeBlock ID="codeblock1" runat="server">
        <script type="text/javascript">
 
            function modifyCommand(imageEditor, args) {
 
                if (args.get_commandName() == "Crop") {
                    waitForCommand(imageEditor, args.get_commandName(), function (widget) {
                        var width = 149;
                        var height = 170;
                        var ratio = width / height;
 
                        //stop the aspect ratio constraint
                        //widget._constraintBtn.set_checked(false);
                        //widget._setCropBoxRatio(null);
                        //widget._sizeRatio = null;
 
                        widget._setCropBoxRatio(ratio);
                        widget._sizeRatio = ratio;
                        widget.set_width(width);
                        widget.set_height(height);
                        widget._constraintBtn.set_enabled(false);
                        widget._updateCropBoxFromControls();
 
                    });
 
                }
                if (args.get_commandName() == "Save") {
//doesn't work
                    setTimeout(function () {
                        $find("<%=RadImageEditor1.ClientID %>").applyChangesOnServer();
                    }, 300) ;
 
                    var filename = imageEditor.getEditableImage();.
//gives error about being unable to deserialize an empty string
                    imageEditor.editImageOnServer("Crop", "Crop", "Crop", callbackFunction);
                    imageEditor.saveImageOnServer(filename, true);
                    imageEditor.setToggleState('Save', false);
                    args.set_cancel(true);
                }
            }
 
 
 
                function callbackFunction(clientData, serverData) {
                    var imgEditor = $find("<%=RadImageEditor1.ClientID %>");
                    imgEditor.getEditableImage()._finishReset();
                }

'always called, always loads original image
  Protected Sub RadImageEditor1_ImageLoading(sender As Object, args As ImageEditorLoadingEventArgs)
        '  Handle Uploaded images
        If Not [Object].Equals(Context.Cache.[Get](Session.SessionID + "UploadedFile"), Nothing) Then
            Using image As New EditableImage(DirectCast(Context.Cache.[Get](Session.SessionID + "UploadedFile"), MemoryStream))
                args.Image = image.Clone()
                args.Cancel = True
            End Using
        End If
    End Sub
'saves original image, not cropped one seen on screen
    Protected Sub RadImageEditor1_ImageSaving(sender As Object, args As Telerik.Web.UI.ImageEditorSavingEventArgs)
        'Save the image to a custom location
        Dim fullPath As String = Server.MapPath("~/temp")
        Dim fileName As String = String.Format("test-{0}.jpg", DateTime.Now.ToString("yyyyMMdd-hhmmss"))
        fullPath = Path.Combine(fullPath, fileName)
          
        Dim img As Telerik.Web.UI.ImageEditor.EditableImage = args.Image
         
 
        Try
 
            img.Image.Save(fullPath)
            'lblError.Text = "File Saved";
            args.Argument = [String].Format("The image is saved under the name: <strong>{0}</strong>.", fileName)
 
            args.Cancel = True
        Catch ex As Exception
            args.Argument = ex.Message
        End Try
 
    End Sub
 
'never called
    Protected Sub RadImageEditor1_ImageEditing(sender As Object, args As ImageEditorEditingEventArgs)
        args.Cancel = True
 
 
    End Sub
Vessy
Telerik team
 answered on 13 Feb 2014
7 answers
72 views
Hello;

There is a bug in Telerik with IE9 and IE10 where the incorrect element is returned from editor.getSelectedElement() (or any related method) for the OnClientCommandExecuting event handler when trying to execute a custom context menu command. This issue is specific to the RadEditor control.

Instead of returning the element the conext menu is fired on, the method returns the root element of the content. I have also posted about this in the following thread: http://www.telerik.com/forums/permalink/IODUuF6XbEygesw-KqOMSg, however since that is not my thread and the title is misleading, I am creating a new post here.

I have verified that the correct value is returned in IE8, and in the thread linked above your developers posted proof that the correct value is returned in Firefox. I have also tested our implementation in Firefox and the correct element is returned as well. From what I can tell this issue is specific to IE9 and IE10. Please advise on a solution as we have a critical issue in production related to this.

Our application requires Internet Explorer due to other 3rd party dependencies so choosing a different browser is not a viable workaround for us.

Thanks,

Richard Shadman
Ianko
Telerik team
 answered on 13 Feb 2014
6 answers
462 views
Hi, i dont find the "max length" property in radeditor, where is it??

i have a varchar(3000) in my database to save the content.
But i dont know how to limit the content in the properties??
Ianko
Telerik team
 answered on 13 Feb 2014
1 answer
111 views
hi
I have a list view with three columns

in  pic1.png  i have  a button and three textbox for insert item , but i wana to be validate input values in textboxs ?

in pic2.png   , i show that .

please help me

tnx
Shinu
Top achievements
Rank 2
 answered on 13 Feb 2014
1 answer
121 views
HI,

I have a Pivot grid with three row groups broken down by Category (1st level), Year (2nd), and Description (3rd).  I have three years (2014,2013,2012) for the Year row groups which is on the second level, but I only want to expand 2014 programmatically on the initial load, and keep 2013 and 2012 collapsed.   I looked at the reference commonly sited here but I only see how that works for the first level groupings, not the second level groupings.

I thought perhaps if I did this in OnLoad:

PivotGrid1.CollapsedRowIndexes.Add(new object[] { "2014" });

it would open the only 2014 on the second level, and "force" the first level open, but that didn't work.

I also tried opening the first level in OnLoad and then expanding one item in the second level but that didn't work either.

PivotGrid1.ExpandAllRowGroups(0);  //Category
PivotGrid1.CollapsedRowIndexes.Add(new object[] { "2014" });


So is there any way I can do this programmatically, or is this not supported?


Maria Ilieva
Telerik team
 answered on 13 Feb 2014
3 answers
139 views
I have a bar chart and I got a little problem in it.. it's grouping all bars to one single x value column .. i need to split each bar to its x value.. take a look at the snap shoot of the problem.. and my code:

RadChart1.PlotArea.XAxis.AutoScale = false;
        RadChart1.PlotArea.XAxis.Items.Clear();
        RadChart1.Series.Clear();
        ChartSeries series = new ChartSeries(dt.Rows[0]["doc_date"].ToString(), ChartSeriesType.Bar);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            series = new ChartSeries(dt.Rows[i]["doc_date"].ToString(), ChartSeriesType.Bar);
           series.Items.Add(new ChartSeriesItem(Convert.ToDouble(dt.Rows[i]["total_timesheet"])));

           ChartAxisItem axisItem = new ChartAxisItem(dt.Rows[i]["doc_date"].ToString());
           RadChart1.PlotArea.XAxis.Items.Add(axisItem);
           RadChart1.Series.Add(series);
        }
Danail Vasilev
Telerik team
 answered on 13 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?