i tried that code without radgrid and is working fine
<script type="text/javascript">
function sum() {
var txtFirstNumberValue = document.getElementById('txt1').value;
var txtSecondNumberValue = document.getElementById('txt2').value;
var result = parseInt(txtFirstNumberValue) + parseInt(txtSecondNumberValue);
if (!isNaN(result)) {
document.getElementById('txt3').value = result;
}
}
</script>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Not Page.ClientScript.IsStartupScriptRegistered("test")) Then
Page.ClientScript.RegisterStartupScript(Me.GetType(), "test", "sum();", True)
End If
End Sub
But my problem was that i'm working with radgrid editform template, i have same 3 text boxes inside radgrid editform template, how to implement the above scenario with radgrid editform template
I'm trying to do a fluid slider where it adjust to screen size. According to the fluid design documentation, if I were to add the control on page, I simply need to set: Width="100%" RenderMode="Lightweight":
http://docs.telerik.com/devtools/aspnet-ajax/controls/slider/mobile-support/responsive,-adaptive-and-elastic-capabilities#fluid-design-with-radslider
This work fine, but I need to create the sliders dynamically. The problem here is when creating in code behind, the Width property is integer only, I can't set to percent, so it can only be set to pixels. Any workaround?
Thanks
Aaron
Hi,
How to fire an OnItemClick event of a RadMenu from code-behind?
Thank you,
ETS
New to the forums so hello to all. I have been using Telerik components for about 6 months now and have noticed an occasional hiccup with the scheduler and (I believe exclusively) IE.
I have attached a file with the worst case scenario. All of the contents of the calendar are squashed to the left of the view which results in a vertical blue line. Sometimes it is less severe with about 50% white space and 50% of the actual calendar so that the information can still be discerned, but just barely. This is not consistently reproducible for me and what works on one machine may not work on another with the same website and browser version.
Has anyone else experienced this? Are there any known IE tweaks or anything to help assist with this problem? I did a search but did not find anything pertaining to this issue so I appreciate any feedback. I am using product version 2010.3.1317.40
I use Rad Editor on Sitecore.
As described below , span tags are erased when I change link with HyperLink Manager.
<li>
<a href="./../solution/products/"><span class="title">products</span></a>
</li>
↓
<li>
<a href="/aspnet-ajax/Editor/images/UserDir/PublicRelations/Telerik at TechEd.doc">/aspnet-ajax/Editor/images/UserDir/PublicRelations/Telerik at TechEd.doc</a>
</li>
This is what I will reproduce even in the demo site .
http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx
Please tell me how to resolve .
Hello,
I have a RadGrid that opens a RadWindow (client side) on row click event.
On the first time I open the RadWindow, fields are empty, but once I fill data in browser and I close the RadWindow, then I open another RadWindow by clicking on another RadGrid's row, I have data filled in the first RadWindow.
I did this and I still have this problem : ReloadOnShow="true" DestroyOnClose="true" EnableViewState="false".
Thanks for helping,
Abitar
I am trying to only allow pdf's and I am running into a javascript error of Object Expected in the UploadValidation.js file. See the attached image. What am I not doing right? Below is my source code.
<%@ Page Title="Authority Meetings" Language="C#" MasterPageFile="~/themes/default/default.master" AutoEventWireup="true" CodeFile="AddEditMeetings.aspx.cs" Inherits="AddEditMeetings" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
Runat
=
"Server"
>
<
script
type
=
"text/javascript"
src
=
"../Scripts/UploadValidation.js"
></
script
>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"../Styles/FileUploadValidation.css"
/>
<
style
type
=
"text/css"
>
#ConstructionPanel {
z-index: 4999 !important;
}
.modal-backdrop
{
background-color: Black;
filter: alpha(opacity=90);
opacity: 0.8;
z-index: 4998 !important;
}
</
style
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
ajax:ToolkitScriptManager
ID
=
"ToolkitScriptManager1"
runat
=
"server"
>
</
ajax:ToolkitScriptManager
>
<
asp:UpdatePanel
ID
=
"UpdatePanel1"
runat
=
"server"
>
<
Triggers
>
<
asp:PostBackTrigger
ControlID
=
"btnSubmit"
/>
</
Triggers
>
<
ContentTemplate
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
EnableShadow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"EventsWindow"
runat
=
"server"
ShowContentDuringLoad
=
"false"
Width
=
"800px"
Height
=
"800px"
Title
=
"Current Road Conditions"
Behaviors
=
"Default"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<
h3
>Authority Meetings</
h3
>
<
asp:LinkButton
ID
=
"lnkBtnNew"
runat
=
"server"
class
=
"btn btn-success"
OnClick
=
"lnkBtnNew_Click"
CausesValidation
=
"False"
><
i
class
=
"icon-plus-sign icon-white"
></
i
> Add New</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"lnkBtnShowMeetings"
runat
=
"server"
CssClass
=
"btn btn-success"
OnClick
=
"lnkBtnShowMeetings_Click"
CausesValidation
=
"False"
><
i
class
=
"icon-plus-sign icon-white"
></
i
> View Page</
asp:LinkButton
>
<
asp:Button
ID
=
"btnHidden"
runat
=
"server"
Style
=
"display: none"
/>
<
ajax:ModalPopupExtender
ID
=
"mpeMeeting"
runat
=
"server"
PopupControlID
=
"MeetingPanel"
DynamicServicePath
=
""
Enabled
=
"True"
TargetControlID
=
"btnHidden"
BackgroundCssClass
=
"modal-backdrop fade in"
/>
<
asp:Panel
runat
=
"server"
ID
=
"MeetingPanel"
DefaultButton
=
"btnSubmit"
CssClass
=
"rounded-bottom rounded-top"
Style="display: none; border: 1px; border-style: solid; border-color: Gray;
background-color: white; padding: 3px; width:60%;">
<
div
class
=
"modal-header"
>
<
h3
>
<
asp:Label
ID
=
"lblAddNewMeeting"
runat
=
"server"
Text
=
"Add a New Meeting"
></
asp:Label
></
h3
>
</
div
>
<
div
class
=
"modal-body form-horizontal"
>
<
asp:TextBox
ID
=
"txtMeetingID"
runat
=
"server"
Visible
=
"false"
></
asp:TextBox
>
<
asp:TextBox
ID
=
"txtLastUpdateDate"
runat
=
"server"
Visible
=
"false"
></
asp:TextBox
>
<
asp:TextBox
ID
=
"txtLastupdateBy"
runat
=
"server"
Visible
=
"false"
></
asp:TextBox
>
<
asp:TextBox
ID
=
"txtCreatedDate"
runat
=
"server"
Visible
=
"false"
></
asp:TextBox
>
<
asp:TextBox
ID
=
"txtCreatedBy"
runat
=
"server"
Visible
=
"false"
></
asp:TextBox
>
<
fieldset
>
<
asp:Panel
ID
=
"pnlMeetingDate"
runat
=
"server"
>
<
legend
>
<
h6
>
Meeting Information:</
h6
>
</
legend
>
<
div
class
=
"control-group"
>
<
asp:Label
ID
=
"lblMeetingDate"
CssClass
=
"control-label"
runat
=
"server"
Text
=
"Date/Time: "
></
asp:Label
>
<
div
class
=
"controls"
>
<
telerik:RadDateTimePicker
Skin
=
"MetroTouch"
ZIndex
=
"500000"
Width
=
"350px"
ID
=
"txtMeetingDate"
runat
=
"server"
>
<
Calendar
ID
=
"Calendar1"
runat
=
"server"
>
<
SpecialDays
>
<
telerik:RadCalendarDay
Repeatable
=
"Today"
ItemStyle-BackColor
=
"Yellow"
>
</
telerik:RadCalendarDay
>
</
SpecialDays
>
</
Calendar
>
</
telerik:RadDateTimePicker
>
<
asp:RequiredFieldValidator
ID
=
"rfvMeetingDate"
runat
=
"server"
ControlToValidate
=
"txtMeetingDate"
ValidationGroup
=
"grpNewMeeting"
ErrorMessage
=
"Both time and date fields must have values."
>*</
asp:RequiredFieldValidator
>
</
div
>
</
div
>
</
asp:Panel
>
</
fieldset
>
<
fieldset
>
<
legend
>
<
h6
>
Add/Edit Meeting Documents:</
h6
>
</
legend
>
<
asp:Panel
ID
=
"pnlDocumentsUpload"
runat
=
"server"
Visible
=
"false"
>
<
div
class
=
"control-group"
>
<
asp:Label
ID
=
"lblDocumentType"
CssClass
=
"control-label"
runat
=
"server"
Text
=
"Document Type: "
></
asp:Label
>
<
div
class
=
"controls"
>
<
asp:DropDownList
ID
=
"ddlFileType"
OnDataBound
=
"ddlFileType_DataBound"
runat
=
"server"
>
</
asp:DropDownList
>
</
div
>
</
div
>
<
div
class
=
"control-group"
>
<
asp:Label
ID
=
"lblSelectFile"
CssClass
=
"control-label"
runat
=
"server"
Text
=
"Select a File: "
></
asp:Label
>
<
div
class
=
"controls"
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"AsyncUpload1"
AllowedFileExtensions
=
"pdf"
MultipleFileSelection
=
"Disabled"
Width
=
"500px"
Skin
=
"Default"
MaxFileInputsCount
=
"1"
OnClientValidationFailed
=
"validationFailed"
UploadedFilesRendering
=
"BelowFileInput"
/>
<
asp:LinkButton
ID
=
"btnUpload2"
runat
=
"server"
onclick
=
"btnUpload2_Click"
CssClass
=
"btn btn-info btn-mini"
><
i
class
=
"icon-edit icon-white"
></
i
>Upload</
asp:LinkButton
>
</
div
>
</
div
>
</
asp:Panel
>
<
div
class
=
"control-group"
>
<
asp:Literal
ID
=
"litUploadError"
runat
=
"server"
/>
</
div
>
</
fieldset
>
<
fieldset
>
<
asp:Panel
ID
=
"pnlDocuments"
runat
=
"server"
>
<
div
class
=
"control-group"
>
<
asp:GridView
ID
=
"gvDocuments"
CssClass
=
"table table-bordered table-striped"
runat
=
"server"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"FileID"
OnRowCommand
=
"gvDocuments_RowCommand"
OnRowCreated
=
"gvDocuments_RowCreated"
OnRowDeleting
=
"gvDocuments_RowDeleting"
GridLines
=
"None"
>
<
Columns
>
<
asp:BoundField
DataField
=
"FileID"
HeaderText
=
"File ID"
InsertVisible
=
"false"
ReadOnly
=
"true"
SortExpression
=
"FileID"
Visible
=
"false"
/>
<
asp:BoundField
DataField
=
"FileName"
HeaderText
=
"File Name"
SortExpression
=
"FileName"
Visible
=
"false"
/>
<
asp:BoundField
DataField
=
"Description"
HeaderText
=
"Description"
SortExpression
=
"Description"
/>
<
asp:BoundField
DataField
=
"ConstructionID"
HeaderText
=
"ConstructionID"
SortExpression
=
"ConstructionID"
Visible
=
"false"
/>
<
asp:BoundField
DataField
=
"CreateDate"
HeaderText
=
"Created Date"
SortExpression
=
"CreateDate"
/>
<
asp:BoundField
DataField
=
"UpdateDate"
HeaderText
=
"Updated Date"
SortExpression
=
"UpdateDate"
Visible
=
"false"
/>
<
asp:TemplateField
>
<
HeaderTemplate
>
Download
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"imgBtnDownload"
runat
=
"server"
CommandArgument='<%# Bind("FileID") %>'
CommandName="Download" CssClass="btn btn-info btn-mini"><
i
class
=
"icon-edit icon-white"
></
i
>View</
asp:LinkButton
>
</
ItemTemplate
>
</
asp:TemplateField
>
<
asp:TemplateField
>
<
HeaderTemplate
>
Delete
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"imgBtnDelete"
runat
=
"server"
CommandArgument='<%# Bind("FileID") %>'
CommandName="Delete" CssClass="btn btn-info btn-mini"><
i
class
=
"icon-edit icon-white"
></
i
>Delete</
asp:LinkButton
>
</
ItemTemplate
>
</
asp:TemplateField
>
</
Columns
>
</
asp:GridView
>
</
div
>
</
asp:Panel
>
</
fieldset
>
<
fieldset
>
<
asp:Panel
ID
=
"pnlMeetingComments"
runat
=
"server"
>
<
legend
>
<
h6
>
Meeting Comments:
</
h6
>
</
legend
>
<
div
class
=
"control-group"
>
<
asp:Label
ID
=
"lblComments"
runat
=
"server"
CssClass
=
"control-label"
Text
=
"Meeting Comments: "
></
asp:Label
>
<
div
class
=
"controls"
>
<
telerik:RadEditor
ID
=
"txtComments"
runat
=
"server"
Width
=
"80%"
Height
=
"250px"
EnableResize
=
"false"
SkinID
=
"DefaultSetOfTools"
ResolvedRenderMode
=
"Classic"
>
<
Tools
>
<
telerik:EditorToolGroup
>
<
telerik:EditorTool
Name
=
"Cut"
/>
<
telerik:EditorTool
Name
=
"Copy"
/>
<
telerik:EditorTool
Name
=
"ConvertToUpper"
/>
<
telerik:EditorTool
Name
=
"ConvertToLower"
/>
<
telerik:EditorTool
Name
=
"Zoom"
/>
<
telerik:EditorTool
Name
=
"FindAndReplace"
/>
<
telerik:EditorTool
Name
=
"Print"
/>
<
telerik:EditorTool
Name
=
"PasteStrip"
/>
<
telerik:EditorTool
Name
=
"PasteFromWord"
/>
<
telerik:EditorTool
Name
=
"PaseFromWordNoFontsNoSizes"
/>
<
telerik:EditorTool
Name
=
"PastePlainText"
/>
<
telerik:EditorTool
Name
=
"PasteHtml"
/>
<
telerik:EditorTool
Name
=
"PasteAsHtml"
/>
<
telerik:EditorTool
Name
=
"Undo"
/>
<
telerik:EditorTool
Name
=
"Redo"
/>
<
telerik:EditorTool
Name
=
"FormatStripper"
/>
<
telerik:EditorTool
Name
=
"InsertParagraph"
/>
<
telerik:EditorTool
Name
=
"FormatBlock"
/>
<
telerik:EditorTool
Name
=
"Indent"
/>
<
telerik:EditorTool
Name
=
"Outdent"
/>
<
telerik:EditorTool
Name
=
"JustifyLeft"
/>
<
telerik:EditorTool
Name
=
"JustifyCenter"
/>
<
telerik:EditorTool
Name
=
"JustifyRight"
/>
<
telerik:EditorTool
Name
=
"JustifyFull"
/>
<
telerik:EditorTool
Name
=
"JustifyNone"
/>
<
telerik:EditorTool
Name
=
"InsertUnorderedList"
/>
<
telerik:EditorTool
Name
=
"InsertOrderedList"
/>
<
telerik:EditorTool
Name
=
"Bold"
/>
<
telerik:EditorTool
Name
=
"Italic"
/>
<
telerik:EditorTool
Name
=
"Underline"
/>
<
telerik:EditorTool
Name
=
"StrikeThrough"
/>
<
telerik:EditorTool
Name
=
"FontName"
/>
<
telerik:EditorTool
Name
=
"RealFontSize"
/>
<
telerik:EditorTool
Name
=
"ForeColor"
/>
<
telerik:EditorTool
Name
=
"BackColor"
/>
<
telerik:EditorTool
Name
=
"LinkManager"
ShortCut
=
"CTRL+K"
/>
</
telerik:EditorToolGroup
>
</
Tools
>
<
Modules
>
<
telerik:EditorModule
Name
=
"RadEditorStatistics"
Visible
=
"false"
Enabled
=
"true"
>
</
telerik:EditorModule
>
<
telerik:EditorModule
Name
=
"RadEditorDomInspector"
Visible
=
"false"
Enabled
=
"true"
>
</
telerik:EditorModule
>
<
telerik:EditorModule
Name
=
"RadEditorNodeInspector"
Visible
=
"false"
Enabled
=
"true"
>
</
telerik:EditorModule
>
<
telerik:EditorModule
Name
=
"RadEditorHtmlInspector"
Visible
=
"false"
Enabled
=
"true"
>
</
telerik:EditorModule
>
</
Modules
>
</
telerik:RadEditor
>
</
div
>
</
div
>
</
asp:Panel
>
</
fieldset
>
<
fieldset
>
<
asp:Panel
ID
=
"pnlStatus"
runat
=
"server"
>
<
legend
>
<
h6
>
Status</
h6
>
</
legend
>
<
div
class
=
"control-group"
>
<
asp:Label
ID
=
"lblStatus"
CssClass
=
"control-label"
runat
=
"server"
Text
=
"Active: "
ToolTip
=
"If you select active this meeting will be displayed on the main web page"
></
asp:Label
>
<
div
class
=
"controls"
>
<
asp:DropDownList
ID
=
"ddlStatus"
runat
=
"server"
>
</
asp:DropDownList
>
</
div
>
</
div
>
<
div
class
=
"control-group"
style
=
"display: none"
>
<
asp:Label
ID
=
"lblVersion"
CssClass
=
"control-label"
runat
=
"server"
Text
=
"Version: "
></
asp:Label
>
<
div
class
=
"controls"
>
<
asp:TextBox
ID
=
"txtVersion"
runat
=
"server"
ReadOnly
=
"true"
></
asp:TextBox
>
<
asp:RegularExpressionValidator
ID
=
"revVersion"
runat
=
"server"
ErrorMessage
=
"* Please enter a valid time."
Display
=
"Dynamic"
ControlToValidate
=
"txtVersion"
ValidationExpression
=
"^[0-9]*$"
>
</
asp:RegularExpressionValidator
>
</
div
>
</
div
>
</
asp:Panel
>
</
fieldset
>
</
div
>
<
div
class
=
"modal-footer"
>
<
div
class
=
"control-group"
>
<
div
class
=
"controls"
>
<
asp:ValidationSummary
ID
=
"vsgrpNewConstruction"
DisplayMode
=
"List"
CssClass
=
"alert alert-error"
ValidationGroup
=
"grpNewMeeting"
runat
=
"server"
ForeColor
=
"Maroon"
/>
<
asp:Label
ID
=
"litSubmitError"
Visible
=
"false"
runat
=
"server"
ForeColor
=
"Maroon"
></
asp:Label
>
</
div
>
</
div
>
<
asp:Button
ID
=
"btnSaveAddDocuments"
CssClass
=
"btn btn-primary"
runat
=
"server"
ValidationGroup
=
"grpNewMeeting"
Text
=
"Add Documents"
CausesValidation
=
"false"
OnClick
=
"btnSaveAddDocuments_Click"
/>
<
asp:Button
ID
=
"btnSubmit"
CssClass
=
"btn btn-primary"
runat
=
"server"
ValidationGroup
=
"grpNewMeeting"
Text
=
"Save"
CausesValidation
=
"false"
OnClick
=
"btnSubmit_Click"
/>
<
asp:Button
ID
=
"btnCancel"
CssClass
=
"btn"
runat
=
"server"
Text
=
"Cancel"
CausesValidation
=
"false"
OnClick
=
"btnCancel_Click"
/>
</
div
>
</
asp:Panel
>
<
div
class
=
"row"
>
<
div
class
=
"span12"
>
<
div
class
=
"control-group"
>
<
div
class
=
"controls"
>
<
asp:Literal
ID
=
"litStatus"
runat
=
"server"
/>
</
div
>
</
div
>
</
div
>
<
div
class
=
"span12"
>
<
telerik:RadGrid
ID
=
"gvMeetings2"
runat
=
"server"
AllowPaging
=
"True"
AllowSorting
=
"true"
AutoGenerateColumns
=
"False"
ResolvedRenderMode
=
"Classic"
onneeddatasource
=
"gvMeetings2_NeedDataSource"
>
<
SortingSettings
EnableSkinSortStyles
=
"false"
></
SortingSettings
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
AlwaysVisible
=
"True"
></
PagerStyle
>
<
Columns
>
<
telerik:GridTemplateColumn
>
<
HeaderTemplate
>
Edit
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"imgBtnEdit"
runat
=
"server"
CssClass
=
"btn btn-info btn-mini"
CommandArgument='<%# Bind("MeetingID") %>' OnClick="imgBtnEdit_Click" ><
i
class
=
"icon-edit icon-white"
>
</
i
> View & Edit</
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"MeetingDate"
FilterControlAltText
=
"Filter MeetingDate column"
HeaderText
=
"Scheduled On"
UniqueName
=
"MeetingDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Comments"
FilterControlAltText
=
"Filter Comments column"
HeaderText
=
"Comments"
UniqueName
=
"companyname"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastUpdateDate"
FilterControlAltText
=
"Filter LastUpdateDate column"
HeaderText
=
"Updated On"
UniqueName
=
"LastUpdateDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastUpdateBy"
FilterControlAltText
=
"Filter LastUpdateBy column"
HeaderText
=
"Edited By"
UniqueName
=
"LastUpdateBy"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CreatedBy"
FilterControlAltText
=
"Filter CreatedBy column"
HeaderText
=
"Created By"
UniqueName
=
"CreatedBy"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CreatedDate"
FilterControlAltText
=
"Filter CreatedDate column"
HeaderText
=
"Created"
UniqueName
=
"CreatedDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Version"
Visible
=
"false"
FilterControlAltText
=
"Filter Version column"
HeaderText
=
"Version"
UniqueName
=
"Version"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"StatusDescription"
FilterControlAltText
=
"Filter StatusDescription column"
HeaderText
=
"Status"
UniqueName
=
"StatusDescription"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
EditItemStyle
BorderWidth
=
"5px"
/>
</
telerik:RadGrid
>
<
asp:UpdateProgress
ID
=
"UpdateProgress1"
AssociatedUpdatePanelID
=
"UpdatePanel1"
runat
=
"server"
>
<
ProgressTemplate
>
<
div
class
=
"progress progress-striped active"
>
<
div
class
=
"bar"
style
=
"width: 100%;"
></
div
>
</
div
>
</
ProgressTemplate
>
</
asp:UpdateProgress
>
</
div
>
</
div
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
asp:Content
>
UploadValidation.js
(
function
() {
var
$;
var
demo = window.demo = window.demo || {};
demo.initialize =
function
() {
$ = $telerik.$;
};
window.validationFailed =
function
(RadAsyncUpload, args) {
var
$row = $(args.get_row());
var
erorMessage = getErrorMessage(RadAsyncUpload, args);
var
span = createError(erorMessage);
$row.addClass(
"ruError"
);
$row.append(span);
}
function
getErrorMessage(sender, args) {
var
fileExtention = args.get_fileName().substring(args.get_fileName().lastIndexOf(
'.'
) + 1, args.get_fileName().length);
if
(args.get_fileName().lastIndexOf(
'.'
) != -1) {
//this checks if the extension is correct
if
(sender.get_allowedFileExtensions().indexOf(fileExtention) == -1) {
return
(
"This file type is not supported."
);
}
else
{
return
(
"This file exceeds the maximum allowed size of 500 KB."
);
}
}
else
{
return
(
"not correct extension."
);
}
}
function
createError(erorMessage) {
var
input =
'<span class="ruErrorMessage">'
+ erorMessage +
' </span>'
;
return
input;
}
})();