<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="asdasD" runat="server"> </asp:ScriptManager> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> var currentLoadingPanel = null; var currentUpdatedControl = null; function RequestStart(sender, args) { currentLoadingPanel = $find("<%= TasksRadAjaxLoadingPanel.ClientID %>"); if (args.get_eventTarget() == "<%= SubmitButton.UniqueID %>") { args.set_enableAjax(false); } currentUpdatedControl = "<%= MainPanel.ClientID %>"; //show the loading panel over the updated control currentLoadingPanel.show(currentUpdatedControl); } function ResponseEnd() { //hide the loading panel and clean up the global variables if (currentLoadingPanel != null) currentLoadingPanel.hide(currentUpdatedControl); currentUpdatedControl = null; currentLoadingPanel = null; } function validateRadUploadFileSize(source, arguments) { var totalFileSize = 0; var maxFileSize = 100000; var radUpload = $find('<%= AttachedFilesRadUpload.ClientID %>'); var fileInputs = radUpload.getFileInputs(); for (var i in fileInputs) { if (fileInputs[i] && fileInputs[i].files[0]) { totalFileSize += fileInputs[i].files[0].fileSize; } } arguments.IsValid = totalFileSize <= maxFileSize; } </script> </telerik:RadCodeBlock> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="SubmitButton"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="MainPanel" LoadingPanelID="TasksRadAjaxLoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" /> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="TasksRadAjaxLoadingPanel" Skin="Vista" runat="server"> </telerik:RadAjaxLoadingPanel> <asp:Panel ID="MainPanel" Width="100%" HorizontalAlign="Left" runat="server"> <telerik:RadProgressManager ID="Radprogressmanager1" Width="403px" runat="server" /> <telerik:RadUpload ID="AttachedFilesRadUpload" InitialFileInputsCount="1" MaxFileInputsCount="10" ControlObjectsVisibility="AddButton, RemoveButtons, CheckBoxes" Width="405px" runat="server" /> <telerik:RadProgressArea runat="server" Width="405px" ID="ProgressArea1" ></telerik:RadProgressArea> <asp:CustomValidator runat="server" ID="CustomValidator1" Display="Dynamic" ClientValidationFunction="validateRadUploadFileSize" OnServerValidate="CustomValidator1_ServerValidate" ValidationGroup="CreateNewTaskValidationGroup"> The maximum upload size is 100 KB </asp:CustomValidator> <asp:Button runat="server" ID="SubmitButton" ValidationGroup="CreateNewTaskValidationGroup" Text="Submit" /> </asp:Panel> </div> </form></body></html>using System;using System.Web.UI.WebControls;public partial class Default2 : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = (AttachedFilesRadUpload.InvalidFiles.Count == 0); }}Microsoft JScript runtime error: Object doesn't support property or method 'get_items'var listbox = document.getElementById("<%=rlbCustomEmails.ClientID %>");var item = new Telerik.Web.UI.RadListBoxItem();item.set_text(email);listbox.get_items().add(item); //I get the error here<telerik:radlistbox runat="server" style="position: absolute; top: 290px; left: 400px;" height="240px" width="255px" ID="rlbCustomEmails"></telerik:radlistbox>I'm using the Simple skin and Q1 2010 version of the controls.
All these elements have initially the same, darkgray background. The control cell (and its column) is quite wide. I would like to change two aspects of their look:
I tried to use GroupHeaderItemStyle. Changing its BackColor changed the back color of the header and the filling cells - but the control cell remained untouched. Changing its Width changed nothing.
I tried to modify Grid.Simple.css file. I've succeeded in changing the back color of all the required elements. But I cannot make the column with the control and filling cells narrower. The MasterTableView is rendered with the "colgroup" element wich contains 20px width of this column. This is the key - is it possible to me to change this value?
Regards
Tomasz
//To validate upload control. function validationFailed(sender, eventArgs) { $telerik.$(".ErrorHolder").html(""); $(".ErrorHolder").append("<p>Attachment exceeding the maximum total size for the file '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow"); } //Remove Error Message. function RemoveErrorMessage(sender, eventArgs) { $(".ErrorHolder").fadeOut("slow"); }
<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload" MultipleFileSelection="Disabled" TemporaryFolder="attachments" TargetFolder="attachments" MaxFileSize="524288" OnFileUploaded="RadAsyncUpload_FileUploaded" OnClientValidationFailed="validationFailed" MaxFileInputsCount="1" OnClientFileUploadRemoved="RemoveErrorMessage"> </telerik:RadAsyncUpload>
public void RadAsyncUpload_FileUploaded(object sender, FileUploadedEventArgs e) { Label fileName = new Label(); fileName.Text = e.File.FileName; string strFileName = string.Empty; if (itotalBytes < iMaxTotalBytes) { // Total bytes limit has not been reached, accept the file e.IsValid = true; itotalBytes += e.File.ContentLength; } else { // Limit reached, discard the file e.IsValid = false; } if (e.IsValid) { string targetFolder = RadAsyncUpload.TargetFolder; strFileName = e.File.FileName; //If same file uploaded again then it will overwrite. e.File.SaveAs(Path.Combine(Server.MapPath(targetFolder), strFileName)); } }It creates RadUploadTestFile file by default in attachment folder.
Why so?? Can we avoid that?
Plus it creates some wired ext file which i upload ... :(
<telerik:RadWindow runat="server" ID="RadWindow1" Skin="Vista" KeepInScreenBounds="true" VisibleOnPageLoad="false" Modal="true" Title="Search Client" Behaviors="Close,Maximize,Move" Width="500" Height="500"> <ContentTemplate> <cti:ucSearchClient ID="searchClient" runat="server" /> </ContentTemplate> </telerik:RadWindow> function openWindow() { var oWnd = radopen(null, "RadWindow1"); } Can you please let me know is there a way to open user control using radwindow and get the selected row values into the main page?
we noticed another issue that if we are using Rad Button in place of Html or ASP.net button, it is calling javascript on pageload even before we click and throws error.