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
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
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
<%@ 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> |
<%@ 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> |
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); |
} |
} |
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; |
} |
} |
} |
Hey guys, i have been coding a radgrid with the option to export the data as excel and word. That all works just fine also the export, but when i change visible true/false the export buttons suddenly will not trigger as the first time.
I have these export buttons inside a radpagelayout. The 3'rd button "btnAddP" has visibility change, so when i click it it will hide the export buttons. When the visibility is back to export buttons, they don't do anything when clicked. I wanted to hear some suggestions from you guys and maybe if someone have had the same issue and how to handle it properly.
01.
<Columns>
02.
<telerik:LayoutColumn Span=
"8"
>
03.
<telerik:RadPageLayout ID=
"rplRadgrid"
runat=
"server"
>
04.
<telerik:LayoutRow>
05.
<Columns>
06.
<telerik:LayoutColumn Span=
"4"
>
07.
<telerik:RadButton ID=
"ibtnExportAsExcel"
runat=
"server"
ToolTip=
"Excel"
OnClick=
"ibtnExportAsExcel_Click"
CssClass=
"Margin"
>
08.
<Image ImageUrl=
"~/Images/filetype-tiny.xls.png"
/>
09.
</telerik:RadButton>
10.
<telerik:RadButton ID=
"ibtnExportAsWord"
runat=
"server"
ToolTip=
"Word"
OnClick=
"ibtnExportAsWord_Click"
11.
<Image ImageUrl=
"~/Images/filetype-tiny.doc.png"
/>
12.
</telerik:RadButton>
13.
<telerik:RadButton ID=
"btnAddP"
runat=
"server"
OnClick=
"btnAddParticipants_Click"
14.
<Image ImageUrl=
"../Images/edit-tiny.png"
/>
15.
</telerik:RadButton>
16.
</telerik:LayoutColumn>
17.
</Columns>
18.
</telerik:LayoutRow>
......
void
ConfigureExport()
{
radgrid.ExportSettings.UseItemStyles =
radgrid.ExportSettings.ExportOnlyData =
radgrid.ExportSettings.IgnorePaging =
radgrid.ExportSettings.OpenInNewWindow =
true
;
radgrid.ExportSettings.FileName = Resources.c3.Export;
}
protected
void
ibtnExportAsExcel_Click(
object
sender, EventArgs e)
{
ConfigureExport();
radgrid.MasterTableView.ExportToExcel();
}
protected
void
ibtnExportAsWord_Click(
object
sender, EventArgs e)
{
ConfigureExport();
radgrid.MasterTableView.ExportToWord();
}
protected
void
btnAddP_Click(
object
sender, EventArgs e)
{
tmrChatBoard.Enabled =
false
;
rplUpdateP.Visible =
true
;
rplRadgrid.Visible =
false
;
}
The application that I'm building is a document repository / content management system. I am using the editor for creating AND displaying a read-only verision of the documents. The issue I'm having now is that if the editor is in Preview Mode, the ribbon is disabled (there is functionality in it that we want available at all times... print, export to word, redirect to the full editor version of the page). But if the editor is in Design Mode, any href's are not able to be clicked (they are treated as raw text). I don't want users to be able to type into this editor, so I have it in Design Mode, but with enableEditing set to false. But having enableEditing turned off causes the context menu (where a user could normally follow a link from one of the selections) to not appear and they get the default windows context menu instead.
I'd really prefer to keep the ribbon (for visual consistency) and let it work as designed, as opposed to creating a series of buttons that appear on the top of the page.
Any suggestions on how to overcome this?
I'd like to remove all context menu options except for "Open Link" on the hyperlink context menu. I've tried to manually set the context menus (based off of old code found in the forums), but it doesn't seem to be working. Is there a list somewhere that tells me ALL of the context menus so that I can disable them? And am I missing something on the method of disabling them? The snippet below represents a few things I've tried. It seems to remove the context menu for "A", but that's the one I'm trying to keep (although I'd like to strip it down to the single "Open Link" option).
This is one of the workarounds I'm trying in regards to my other question from a few days ago (no answers on that one yet either)
Thanks so much for any help!
<
ContextMenus
>
<
telerik:EditorContextMenu
TagName
=
"P"
Enabled
=
"false"
>
<
telerik:EditorTool
Name
=
"JustifyLeft"
Enabled
=
"false"
/>
<
telerik:EditorTool
Name
=
"JustifyCenter"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"JustifyRight"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"JustifyFull"
Visible
=
"false"
/>
</
telerik:EditorContextMenu
>
<
telerik:EditorContextMenu
TagName
=
"BODY"
Enabled
=
"false"
>
<
telerik:EditorTool
Name
=
"Cut"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"Copy"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"Paste"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"PasteFromWord"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"PastePlainText"
Visible
=
"false"
/>
<
telerik:EditorTool
Name
=
"PasteAsHtml"
Visible
=
"false"
/>
</
telerik:EditorContextMenu
>
</
ContextMenus
>