Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
383 views
I have a TreeView with checkboxes turned on and each child node has a datavalue and a textbox.  When a user types in the textbox, each time she hits the spacebar, the checkbox on that node and each parent node.  I need to disable this behavior.  Ideally, I would just disable the toggling to the checkboxes on spacebar.  Does anybody have any idea how to accomplish this?
Quinn
Top achievements
Rank 1
 answered on 25 Jul 2019
1 answer
250 views

Hi,

i am trying to represent year/month and year/quarter in the chart as in the attached pictures. Standard features in excel amongst other, but I can't find a solution for it in Telerik. 

 

Terje

Vessy
Telerik team
 answered on 24 Jul 2019
1 answer
133 views

Hello,

RadEditor controls toolbar (Bold, Italic, etc) is not working on the latest version of Firefox 68.0.1 (64-bit), i tried fixing the issue using ".onParentNodeChanged()" solution that i found on the forum but with no result.

<asp:Content runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="True" Skin="IP" EnableEmbeddedSkins="false" VisibleTitlebar="true" VisibleStatusbar="false" AutoSize ="true">
                <Windows>
                    <telerik:RadWindow ID="rwdAddActionTaken" runat="server" Title="Add Response" Modal="true" Skin="IP" EnableEmbeddedSkins="false" 
                        VisibleTitlebar="true" ShowContentDuringLoad="false" VisibleStatusbar="false" Behaviors="Close" AutoSize="true" Width="700px" Height="550px"
                        OnClientShow="fixEditor">
                        <ContentTemplate>
                            <telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" ContentAreaMode="Div" SkinID="DefaultSetOfTools"
                Height="675px">
                                        <Tools>
                                                    <telerik:EditorToolGroup Tag="Top">
                                                        <telerik:EditorTool Name="Bold" />
                                                        <telerik:EditorTool Name="Italic" />
                                                        <telerik:EditorTool Name="Underline" />
                                                        <telerik:EditorTool Name="StrikeThrough" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="InsertOrderedList" />
                                                        <telerik:EditorTool Name="InsertUnorderedList" />
                                                        <telerik:EditorTool Name="Outdent" />
                                                        <telerik:EditorTool Name="Indent" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="FontName" />
                                                        <telerik:EditorTool Name="RealFontSize" />
                                                        <telerik:EditorTool Name="ForeColor" />
                                                        <telerik:EditorTool Name="BackColor" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="Undo"/>
                                                        <telerik:EditorTool Name="Redo" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="Cut" />
                                                        <telerik:EditorTool Name="Copy" />
                                                        <telerik:EditorTool Name="PasteAsHtml" />
                                                        <telerik:EditorTool Name="PastePlainText" />
                                                    </telerik:EditorToolGroup>
                                                    <telerik:EditorToolGroup Tag="Middle">
                                                        <telerik:EditorTool Name="JustifyLeft" />
                                                        <telerik:EditorTool Name="JustifyCenter" />
                                                        <telerik:EditorTool Name="JustifyRight" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="InsertLink" />
                                                    </telerik:EditorToolGroup>
                                                </Tools>                                   
                                            </telerik:RadEditor>  
                            </ContentTemplate>
                    </telerik:RadWindow>
                    </Windows>
            </telerik:RadWindowManager>
    <script type="text/javascript">
    function fixEditor()
    {
        $find("<%=RadEditor1.ClientID %>").onParentNodeChanged();
    }
</script>
</asp:Content>
Rumen
Telerik team
 answered on 24 Jul 2019
11 answers
1.0K+ views
Hi,
    I have several boundcolumn in my radgrid. I want to access one of the cell and assign hyperlink dynamically. How do I do this. Can anybody help. thanks in advance
Ryan
Eyup
Telerik team
 answered on 24 Jul 2019
1 answer
178 views

Hello,

I need to show the NestedViewTemplate for a row when that row is edited using in-place editing. How can I achieve this? So far what I have tried was calling the expand event on the Edit command like so:

if(e.CommandName == RadGrid.EditCommandName)
       {
           e.Item.FireCommandEvent(RadGrid.ExpandCollapseCommandName, new GridExpandCommandEventArgs(e.Item, sender, e));
           //e.Item.Expanded = true;
       }

 

The RadGrid.ExpandCollapse command is correctly being fired but the in-place editing is showing and the NestedViewTemplate is not showing as intended.

Eyup
Telerik team
 answered on 24 Jul 2019
2 answers
422 views
Hi,

I have a RadGrid working where on add and edit events a user control is defined to be used for user inputs.
Now I have a scenario where I want to clone one of the record from a button (placed on that user control).
When user clicks clone button, I want to fire up the "Add new record" event of RadGrid and populate data from the source record so the user may change some values and click save to clone the record.

I cannot find a way to fire the "Add new record" event from a custom button on the usercontrol. Any help ideas to achieve this are appreciated.

Thanks,
Bash
Mark
Top achievements
Rank 2
 answered on 23 Jul 2019
3 answers
816 views

 

I have the following button:

                  <telerik:RadLinkButton ID="lbtn" runat="server" Text="Delete"
                                       Height="34px" 
                                       style="margin-top:2px;"
                                       OnClientClicking="return false;">
                    <Icon CssClass="rbRemove"></Icon>
                </telerik:RadLinkButton>

 

It does that i need it to do however causes "Uncaught SyntaxError: Unexpected token return" javascript error.

What is wrong?

Thank you

Rumen
Telerik team
 answered on 23 Jul 2019
3 answers
361 views

Hello,

I need to disable the edit and insert modal without disabling the drag and drop and resize functionality for appointments. I am currently handling the server side AppointmentClick on my own and I don't want the default edit modal to display when I double click the appointment. Is there a way to just disable the edit modal without affecting the resize appointment, delete appointment and drag and drop update?

 

Thanks for your help

Gonzalo
Top achievements
Rank 1
 answered on 23 Jul 2019
3 answers
232 views

Hi,

I am using Radwindow in my asp.net application as below

 

    <telerik:RadWindow VisibleOnPageLoad="false" Behaviors="Close,Move,Maximize,Resize" VisibleStatusbar="false" VisibleTitlebar="true" Modal="true"     ShowContentDuringLoad="false" ID="rwEdit" runat="server" KeepInScreenBounds="true" InitialBehaviors="Maximize" Style="z-index: 9000"     AutoSizeBehaviors="Width, Height" AutoSize="true">
     </telerik:RadWindow>

 

In my javascript I set the url and display the window

 

    var rWindow = $find(rwEdit);
    if (rWindow) {
        //rWindow.allow = 'camera';   // Tried to set the camera
        rWindow.setSize(1000, 800);
        rWindow.set_title('Open Form');
        rWindow.set_modal(true);
        rWindow.setActive(true);
        rWindow.setUrl('http://localhost:8080/execute/1563377889038?pid=1');
        rWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize + Telerik.Web.UI.WindowBehaviors.Maximize);
        rWindow.show();
        rWindow.add_close(OnClientClose);

}

 

On executing the Radwindow creates a iframe (as seen in dev tools) with the same id as RadWindow. I want to use the camera(webcam) within the iframe. I have tried giving the attribute 'allow' in the javascript but it does not work. 

 

Could I please have some help with this? How can I enable the feature policy of 'camera'?

 

Thanks

Deepam

 

Rumen
Telerik team
 answered on 23 Jul 2019
5 answers
672 views
Hi,
I'm have a page called FileManager.aspx that is calling another page called FileUpload.aspx in a RadWindow.

The FileUpload.aspx (in a RadWindow) has one asp:Button (uxFileUploadReturnButton) that submits the form and has a OnClick event named FileUploadReturnButton_Click .

In this click event, it iterates through the UploadedFiles (UploadedFileCollection) and does several business logic - one of which is to use the SaveAs method to save the file in a different file name (GUID in my case).

However, when doing the above, I encountered an error saying that the "temporary file" cannot be found.

When debugging, I notice that upon reaching my click event handler in my presenter class, the files has already been moved over to the Target Folder - with their original file names.

I'm not certain where the problem is to achieve using the SaveAs method in my asp.net web application.

Note: I've registered the Panel which contains the AsynchUpload control to the RadAjaxManager.
Note: I'm using RadControls version 2010.1 309 in VS 2008 SP1

FileMangager.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/Dev/AccountLayout.master" AutoEventWireup="true" CodeBehind="FileManager.aspx.cs" Inherits="Dev.FileManager" %> 
<asp:Content ID="uxFileManagerContentContainerContent" ContentPlaceHolderID="uxAccountLayoutContentContainerContentPlaceHolder" runat="server">  
 
<asp:Button ID="Button1" runat="server" Text="Upload Files" /> 
 
<telerik:RadWindow ID="RadWindow2" runat="server"  OpenerElementId="<%# Button1.ClientID %>" NavigateUrl="~/FileUpload/" 
    AutoSize="false" Behaviors="Close" DestroyOnClose="true" KeepInScreenBounds="true" Modal="true" 
    RegisterWithScriptManager="true" Title="Upload File" VisibleStatusbar="false" Width="600" Height="350">  
</telerik:RadWindow > 
 
</asp:Content> 
 

FileUpload.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/Dev/WindowLayout.master" AutoEventWireup="true" CodeBehind="FileUpload.aspx.cs" Inherits="Dev.FileUpload" Theme="Default" %> 
<asp:Content ID="uxFileUploadContentContainerContent" ContentPlaceHolderID="uxWindowLayoutContentContainerContentPlaceHolder" runat="server">  
    <div id="uxFileUploadContainerWrapperDiv">  
        <div id="uxFileUploadContainerDiv">  
            <asp:Panel ID="uxFileUploadContainerPanel" runat="server">  
                <div id="uxFileUploadHeaderWrapperDiv">  
                    <div id="uxFileUploadHeaderDiv">  
                        <asp:Panel ID="uxFileUploadBeginUploadHeaderPanel" CssClass="cssFileUploadBeginUploadHeaderPanel" runat="server" Visible="true">  
                            <h1> 
                                <asp:Label ID="uxFileUploadBeginUploadTitleLabel" CssClass="cssFileUploadBeginUploadTitleLabel" runat="server" Text="Upload to My Files"></asp:Label>      
                            </h1> 
                        </asp:Panel> 
                        <asp:Panel ID="uxFileUploadEndUploadHeaderPanel" CssClass="cssFileUploadEndUploadHeaderPanel" runat="server" Visible="false">  
                            <h1> 
                                <asp:Label ID="uxFileUploadEndUploadTitleLabel" CssClass="cssFileUploadEndUploadTitleLabel" runat="server" Text="Upload Complete"></asp:Label> 
                            </h1> 
                        </asp:Panel> 
                    </div> 
                </div> 
                <div id="uxFileUploadContentWrapperDiv">  
                    <div id="uxFileUploadContentDiv">  
                        <asp:Panel ID="uxFileUploadBeginUploadContentPanel" CssClass="cssFileUploadBeginUploadContentPanel" runat="server" Visible="true">  
                            <telerik:RadProgressManager ID="uxFileUploadRadProgressManager" runat="server" EnableMemoryOptimization="true" RegisterWithScriptManager="true" /> 
                            <div id="uxFileUploadFileListHeaderDiv">  
                                <div id="uxFileUploadFileNameColumnDiv">  
                                    <asp:Label ID="uxFileUploadFileNameColumnLabel" runat="server" Text="File Name"></asp:Label>      
                                </div> 
                                <div id="uxFileUploadRemoveColumnDiv">  
                                    <asp:Label ID="uxFileUploadRemoveColumnLabel" runat="server" Text="Remove?"></asp:Label>      
                                </div> 
                            </div> 
                            <div id="uxFileUploadFileListContainerDiv" class="cssFileUploadFileListContainerDiv">  
                                <telerik:RadAsyncUpload ID="uxFileUploadRadAsyncUpload" CssClass="cssFileUploadRadAsyncUpload" runat="server" AutoAddFileInputs="true"   
                                    ControlObjectsVisibility="None" EnableFileInputSkinning="true" FocusOnLoad="true" Localization-Select="Add File" 
                                    ReadOnlyFileInputs="true" OnFileUploaded="FileUploadRadAsyncUpload_FileUploaded" RegisterWithScriptManager="true">  
                                </telerik:RadAsyncUpload> 
                                <telerik:RadProgressArea ID="uxFileUploadRadProgressArea" CssClass="cssFileUploadRadProgressArea" runat="server" RegisterWithScriptManager="true" 
                                    ProgressIndicators="FilesCountBar,FilesCount,FilesCountPercent,SelectedFilesCount,CurrentFileName,TimeElapsed,TimeEstimated">  
                                </telerik:RadProgressArea> 
                            </div>                          
                            <div id="uxFileUploadFileListFooterDiv">  
                                <div id="uxFileUploadTotalsDiv">  
                                    <asp:Label ID="uxFileUploadTotalLabel" CssClass="cssFileUploadTotalLabel" runat="server" Text="Total:"></asp:Label> 
                                    <asp:Label ID="uxFileUploadFileCountLabel" CssClass="cssFileUploadFileCountLabel" runat="server" Text="0"></asp:Label> 
                                    <asp:Label ID="uxFileUploadUnitFileLabel" CssClass="cssFileUploadUnitFileLabel" runat="server" Text="files,"></asp:Label> 
                                    <asp:Label ID="uxFileUploadFileSizeLabel" CssClass="cssFileUploadFileSizeLabel" runat="server" Text="0"></asp:Label> 
                                    <asp:Label ID="uxFileUploadUnitSizeLabel" CssClass="cssFileUploadUnitSizeLabel" runat="server" Text="MB"></asp:Label> 
                                </div> 
                            <br /> 
                            </div> 
                            <div id="uxFileUploadUserActionDiv" class="cssFileUploadUserActionDiv">  
                                <asp:Button ID="uxFileUploadSaveFilesButton" runat="server" Text="Save Uploaded Files" OnClick="FileUploadSaveFilesButton_Click" /> 
                            </div> 
                        </asp:Panel> 
                        <asp:Panel ID="uxFileUploadEndUploadContentPanel" CssClass="cssFileUploadEndUploadContentPanel" runat="server" Visible="false">  
                            <asp:Label ID="uxFileUploadEndUploadMessageLabel" CssClass="cssFileUploadEndUploadMessageLabel" runat="server" Text="Your upload was completed successfully."></asp:Label> 
                            <asp:Button ID="uxFileUploadReturnButton" CssClass="cssFileUploadReturnButton" runat="server" Text="Return to My Files" OnClick="FileUploadReturnButton_Click" /> 
                        </asp:Panel> 
                    </div> 
                </div> 
                <div id="uxFileUploadFooterWrapperDiv">  
                    <div id="uxFileUploadFooterDiv">  
                    </div> 
                </div> 
            </asp:Panel> 
        </div> 
    </div> 
</asp:Content> 

FileUpload.aspx.cs

        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!this.IsPostBack)  
            {  
                Presenter.ViewInitializedEventHandler(sender, e);  
            }  
            else 
            {  
                Presenter.ViewLoadedEventHandler(sender, e);  
            }  
        } 

        protected void FileUploadSaveFilesButton_Click(object sender, EventArgs e)  
        {  
            if (FileUploadSaveFilesButtonClickEventHandler != null)  
            {  
                FileUploadSaveFilesButtonClickEventHandler(sender, e);  
            }  
        } 

FileUploadPresenter.cs (class library)

        public override void ViewInitializedEventHandler(object sender, EventArgs e)  
        {  
            // View initilization logic.  
            ConfigureAjaxSettings();  
            ConfigureControls();  
            LoadViewData();  
        }  
 
        public override void ViewLoadedEventHandler(object sender, EventArgs e)  
        {  
            // View loaded logic.  
            ConfigureAjaxSettings();  
 
            // Delegate view events to the presenter.  
            ConfigureEventHandlers();  
        }  
 
        private void ConfigureAjaxSettings()  
        {  
            View.WindowLayoutRadAjaxManager.AjaxSettings.AddAjaxSetting(View.FileUploadSaveFilesButton, View.FileUploadBeginUploadContentPanel);  
        }  
 
        private void ConfigureEventHandlers()  
        {  
            View.FileUploadSaveFilesButtonClickEventHandler += new EventHandler<EventArgs>(FileUploadSaveFilesButtonClickEventHandler);  
            View.FileUploadReturnButtonClickEventHandler += new EventHandler<EventArgs>(FileUploadReturnButtonClickEventHandler);  
            View.FileUploadRadAsyncUploadFileUploadedEventHandler += new EventHandler<FileUploadedEventArgs>(FileUploadRadAsyncUploadFileUploadedEventHandler);  
        } 

        private void FileUploadSaveFilesButtonClickEventHandler(object sender, EventArgs e)  
        {  
            string targetFolder = _configurationDefinition.FileUploadTargetFolder;  
            int upperBound = View.FileUploadRadAsyncUpload.UploadedFiles.Count;  
            string[] fileSystemNames = new string[upperBound];  
            string[] uploadedFileNames = new string[upperBound];  
            string[] fileTitles = new string[upperBound];  
            int[] fileSizes = new int[upperBound];  
            string[] fileContentTypes = new string[upperBound];  
            string[] fileExtensions = new string[upperBound];              
              
            try 
            {  
                UploadedFileCollection uploadedFiles = View.FileUploadRadAsyncUpload.UploadedFiles;  
                for (int index = 0; index < uploadedFiles.Count; index++)  
                {  
                    fileSystemNames[index] = _cryptographyService.GenerateAlphaNumericGUID();  
                    uploadedFileNames[index] = uploadedFiles[index].GetName();  
                    fileTitles[index] = uploadedFiles[index].GetNameWithoutExtension();  
                    fileSizes[index] = uploadedFiles[index].ContentLength;  
                    fileContentTypes[index] = uploadedFiles[index].ContentType;  
                    fileExtensions[index] = uploadedFiles[index].GetExtension();  
                    // Save the file as a GUID file name  
                    uploadedFiles[index].SaveAs(targetFolder + fileSystemNames[index]);  
                }  
 
                // Add the files to database  
                _fileUploadService.AddFiles(fileSystemNames, uploadedFileNames, fileTitles, fileSizes, fileContentTypes, fileExtensions);  
 
                // Display the File Upload Complete view  
                ToggleFileUploadViews();  
            }  
            catch 
            {  
                try 
                {  
                    // For any errors delete the files that were moved to the Target Folder  
                    foreach (string fileSystemName in fileSystemNames)  
                    {  
                        if (System.IO.File.Exists(targetFolder + fileSystemName))  
                        {  
                            System.IO.File.Delete(targetFolder + fileSystemName);  
                        }  
                    }  
                }  
                catch 
                {  
                    throw;  
                }  
            }  
        } 

Error Message

System.IO.FileNotFoundException was caught
  Message="Could not find file 'C:\\Dev\\App_Data\\TemporaryFiles\\1lsi1z34.y5v'."
  Source="mscorlib"
  FileName="C:\\Dev\\App_Data\\TemporaryFiles\\1lsi1z34.y5v"
  StackTrace:
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.File.Move(String sourceFileName, String destFileName)
       at Telerik.Web.UI.AsyncUploadedFile.SaveAs(String fileName, Boolean overwrite)
       at Dev.FileUploadPresenter.FileUploadSaveFilesButtonClickEventHandler(Object sender, EventArgs e) in C:\Dev\FileUploadPresenter.cs:line 125

Many Thanks,
Henry Wu
saurabh
Top achievements
Rank 1
 answered on 23 Jul 2019
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?