Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
48 views
Hi.

I found a few old posts regarding the issue of the drag and drop feature (within the same grid) calling a function to set the new row order in the backend Db.  The one from 9/2008 in the Code Files section lacks a lot of information (the DragDrop.js file referenced in the in-line script, and the SqlDataSource called in the code-behind.  I am very interested in using such a function, and wonder if there is any updated information somewhere that I could tap.

Thanks.

Tom
Veli
Telerik team
 answered on 10 Feb 2011
1 answer
117 views
Hi All,

I am using 'RadDatePicker' in my web application. I am using following java script to display current date as selected date by default and this script is working fine. My problem is that for selecting selected date(which is by default current date) i have to click two time on same date, first click remove its selection and second click select it and display it in date picker. i just want to do selection of selectted date at single click.
Please help me its urgent.

function

 

CurrentDateSelection(sender, eventArgs) { 
 
        if (sender.get_selectedDate() == null) {
        eventArgs.set_cancelCalendarSynchronization(
true);
        
 var popup = eventArgs.get_popupControl();
        
 var todaysDate = new Date(); 
        
 var todayTriplet = [todaysDate.getFullYear(), todaysDate.getMonth() + 1, todaysDate.getDate()]; 
        popup.selectDate(todayTriplet,
true); 
     }
}

-----------------------------------------
 <telerik:RadDatePicker ID="RadDatePickerAnswerDate" runat="server" Width="110px"> 
<DateInput ID="DateInput25" runat="server" DateFormat="MM/dd/yyyy" /> 
<ClientEvents OnPopupOpening="CurrentDateSelection" />
</telerik:RadDatePicker>

 

 

 

 

 

 

 

 

 

 

 

 

 

Pavel
Telerik team
 answered on 10 Feb 2011
1 answer
87 views
Hai

I have placed the rad upload control inside the edit item template . But the page is reloaded at every time. If i add update panel the page i am unable to read the file from rad upload. How can i solve the page reload issue with rad grid and rad upload controls.


Thanks
Nikolay Rusev
Telerik team
 answered on 10 Feb 2011
2 answers
126 views
Hi All,

I have an error when i try to upload a file size greater than 100Mo !. I don't understand if this error come from IIS or AsyncUpload ?
I do my test on my local machine with IIS 7.5 (Windows 7 Ultimate) and on my server with IIS 7.5 (windows 2008 R2 DataCenter) and i have the same error.

My web.config :
<security><requestLimits maxAllowedContentLength="314572800" /></requestFiltering></security>

My Upload.aspx :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="dialogs_upload" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
<script type="text/javascript">
    var Nbre = 0;
        function getRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        function CloseWindow() {
            var wnd = getRadWindow();
            var openerPage = wnd.BrowserWindow;
            openerPage.Importer_Callback();
            wnd.close();
        }
        function validateRadUpload1(source, arguments) {
            arguments.IsValid = $find('RadUpload1').validateExtensions();
        }
        function fileUploaded(sender, args) {
            Nbre++;
            var name = args.get_fileName();
            var $ = $telerik.$;
              $(".info-panel").text(Nbre).show();  
        }
          
        </script>
        <link href="../css/principal.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form runat="server" id="mainForm" method="post">
        <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"></telerik:RadFormDecorator>
        <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
        <div class="popup-texte-edit" style="height:30px; padding:5px"><strong>Cliquez sur le bouton "Parcourir" et selectionnez le ou les fichiers à importer</strong><br /><em>(utilisez la touche 'CTRL' pour séléctionner plusieurs fichiers à la fois).</em></div>
        <div style="margin:10px;background-color: #EEEEEE;">
            <div style="background-color: #CC0000; color: #FFDDDD; font-size: 11px; margin-bottom: 10px; padding: 5px;">Fichiers autorisés : <strong><asp:Literal ID="FileAllowed" runat="server" Text="" /></strong><span style="color:#fff; font-size:11px;float:right;display:inline-block">(Taille maximale du fichier : 300 Mo)</span></div>
            <div style="background-color: #EEEEEE; border: 1px dashed #CCCCCC; height: 180px; overflow-y: auto; padding: 5px 10px;" class="upload-panel">
                <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MaxFileSize="300000000" OnClientFileUploaded="fileUploaded" ControlObjectsVisibility="None" ReadOnlyFileInputs="true" InitialFileInputsCount="1" MaxFileInputsCount="1" InputSize="70" Localization-Remove="Supprimer" Localization-Select="Parcourir" />
                <asp:CustomValidator ID="Customvalidator1" runat="server" Display="Dynamic" ClientValidationFunction="validateRadUpload1">
                <span style="FONT-SIZE: 11px;margin-left:50px;font-weight:bold;color:#ff0000">!!! Type de fichier incorrect !!!</span>
                </asp:CustomValidator><asp:Literal ID="MaxFileError" runat="server" />
            </div>
            <div style="background-color: #ddd; float: left; width: 100%;">
                <div style="background-color: #ddd; float: left; width: 312px;line-height: 22px;"> <asp:CheckBox ID="Encodage" runat="server" Text="Encoder la vidéo" /></div>
                <div style="background-color: #ddd; float: right; font-size: 11px; line-height: 22px; padding: 0 10px; text-align: right; width: 215px;">Nbre de fichiers importés : <span class="info-panel" style="font-weight:bold;display:inline">0</span></div>
            </div>
        </div>
        <div style="position: absolute; top: 100px; left: 73px;"><telerik:RadProgressArea runat="server" ID="RadProgressArea1"></telerik:RadProgressArea></div>
        <div id="ErrorHolder"></div>
        <table width="100%" cellspacing="5">
            <tr>
                <td align="center" height="50" valign="middle"><asp:Button id="buttonSubmit" runat="server" CssClass="RadUploadSubmit" OnClick="buttonSubmit_Click" Text="Valider" /></td>
                <td align="center" height="50" valign="middle"><asp:Button ID="Button2" runat="server" Text="Annuler" CausesValidation="false"  OnClientClick="return CloseWindow();" /></td>
            </tr>
        </table>
    </form>
</body>
</html>

My upload.aspx.cs :
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using Telerik;
  
public partial class dialogs_upload : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Params["Mode"] != null)
        {
            RadProgressArea1.Localization.Uploaded = "Progression totale : ";
            RadProgressArea1.Localization.UploadedFiles = "Progression : ";
            RadProgressArea1.Localization.CurrentFileName = "Progession en cours : ";
            RadProgressArea1.Localization.ElapsedTime = "Temps : ";
            RadProgressArea1.Localization.EstimatedTime = "Temps estimé : ";
            RadProgressArea1.Localization.TotalFiles = "Total : ";
            RadProgressArea1.Localization.TransferSpeed = "Vitesse : ";
  
            if (Request.Params["Mode"].ToString() == "photos")
            {
                FileAllowed.Text = "*.jpeg, *.jpg";
                AsyncUpload1.AllowedFileExtensions = new string[] { ".jpg", ".jpeg", ".gif" };
                Encodage.Visible = false;
                AsyncUpload1.ControlObjectsVisibility = Telerik.Web.UI.ControlObjectsVisibility.None;
                AsyncUpload1.MultipleFileSelection = Telerik.Web.UI.AsyncUpload.MultipleFileSelection.Automatic;
            }
            if (Request.Params["Mode"].ToString() == "videos")
            {
                FileAllowed.Text = "*.flv, *.avi, *.mov, *.mp4, *.mpeg, *.mpg, *.wmv";
                AsyncUpload1.AllowedFileExtensions = new string[] { ".flv", ".avi", ".mov", ".mp4", ".mpeg", ".mpg", ".wmv" };
                AsyncUpload1.MaxFileInputsCount = 1;
                AsyncUpload1.ControlObjectsVisibility = Telerik.Web.UI.ControlObjectsVisibility.None;
                AsyncUpload1.MultipleFileSelection = Telerik.Web.UI.AsyncUpload.MultipleFileSelection.Disabled;
                AsyncUpload1.TemporaryFolder = Server.MapPath("/WorkingFolder/");
            }
            if (Request.Params["Mode"].ToString() == "audio")
            {
                FileAllowed.Text = "*.mp3,*.wav,*.flv, *.avi, *.mov, *.mp4, *.mpeg, *.mpg, *.wmv, *.mp2";
                AsyncUpload1.AllowedFileExtensions = new string[] { ".mp3", "wav", ".flv", ".avi", ".mov", ".mp4", ".mpeg", ".mpg", ".wmv", ".mp2", ".wma" };
                Encodage.Visible = false;
                AsyncUpload1.MaxFileInputsCount = 1;
                AsyncUpload1.ControlObjectsVisibility = Telerik.Web.UI.ControlObjectsVisibility.None;
                AsyncUpload1.MultipleFileSelection = Telerik.Web.UI.AsyncUpload.MultipleFileSelection.Disabled;
            }
        }
  
    }
  
    protected void buttonSubmit_Click(object sender, System.EventArgs e)
    {
        string targetFolder = "", filename = "", fileWithoutExtension = "";
        bool encoder = false;
        if (AsyncUpload1.UploadedFiles.Count > 0)
        {
            foreach (UploadedFile validFile in AsyncUpload1.UploadedFiles)
            {
                filename = validFile.GetName();
                fileWithoutExtension = validFile.GetNameWithoutExtension();
                encoder = Encodage.Checked;
                if (Request.Params["Mode"].ToString() == "videos")
                {
                    if (((validFile.GetExtension() != ".flv") && (validFile.GetExtension() != ".mp4")) || (encoder)) { targetFolder = Server.MapPath("/WorkingFolder/"); encoder = true; }
                    else { targetFolder = Server.MapPath(Request.Params["Folder"].ToString()); }
                }
                else if (Request.Params["Mode"].ToString() == "audio")
                {
                      
                    if ((validFile.GetExtension() != ".mp3")) { targetFolder = Server.MapPath("/WorkingFolder/"); encoder = true; }
                    else { targetFolder = Server.MapPath(Request.Params["Folder"].ToString()); }
                }
                else { targetFolder = Server.MapPath(Request.Params["Folder"].ToString()); }
  
                filename =  validFile.GetExtension();
                fileWithoutExtension = fileWithoutExtension;
                validFile.SaveAs(Path.Combine(targetFolder, filename), true);          
            }
       }       
    }
  
    protected void Customvalidator1_ServerValidate(object source, ServerValidateEventArgs args)
    {
        args.IsValid = (AsyncUpload1.InvalidFiles.Count == 0);
    }
  
    protected void RadUpload1_ValidatingFile(object sender, Telerik.Web.UI.Upload.ValidateFileEventArgs e)
    {
            long maxZipFileSize = 300000000;
            if (e.UploadedFile.ContentLength > maxZipFileSize)
            {
                e.IsValid = false;
            }
            e.SkipInternalValidation = true;
    }
}

I don't found any documentation about this problem !

Can someone help me ?

thanx
Kate
Telerik team
 answered on 10 Feb 2011
1 answer
72 views
Hi,

Radcombobox Dropdown display behind RadAjaxPanel (after applying css to ajax panel)

Thanks
R
Top achievements
Rank 1
 answered on 10 Feb 2011
1 answer
65 views
Hello!

Using the ASP .NET PieChart - is there a possibility to set a threshold so that all values below that threshold generate a segment "Other".
Because it is really ugly having a lot of values < x%.

Thanks a lot and greetings,
Tim.
Yavor
Telerik team
 answered on 10 Feb 2011
6 answers
81 views
Hi,

       I have a RadComboBox which will contain all the Column name of RadGrid. Next To the RadComboBox I have a RadTextBox. when i enter a value in textbox and i choose any item in the comboBox, then that particular column in  RadGrid (all the rows) should be Updated with the Value entered in the TextBox. Is it is possible. How ? any Sample code is available.
Venkatesh
Top achievements
Rank 1
 answered on 10 Feb 2011
1 answer
173 views
Hi, 

In Telerik RadScheduler, I need to design a model in which a client is accessed to schedule only once. Once he/she is scheduled, all the other Appointments are disabled and he cannot schedule more than once.
If he/ she wants to schedule again, then the previous appointment has to be deleted and then be scheduled at his/her convenience.
Any help is appreciated.
Shinu
Top achievements
Rank 2
 answered on 10 Feb 2011
3 answers
307 views
hi telerik team,
I have got an issue regarding radcombobox.The scenario is as follow.
I have a radcombobox in the middle of the form .
On the selected changed indexed of this radcombobox i have to fill some textboxes that are on  the form.This radcombobox and the text boxes are using ajax to avoid postback.But when i do click on this radcombobox ,the screens scrolls down to the top .Can you please tell why is it happening?
Shinu
Top achievements
Rank 2
 answered on 10 Feb 2011
4 answers
478 views
After going through the documentation and looking a several forum posts, I am still having trouble getting a reference to a textbox inside a FormTemplate:

<FormTemplate>
   <asp:TextBox ID="MyTextbox" runat="server" Text='<%# Bind( "some_value_from_database") %>' Columns="80" />
                                
    <asp:Button ID="SendTestEmail" Text='Send Test Email' runat="server" CommandName='some_command' CommandArgument='<%# Eval("some_database_ID") %>' />
</FormTemplate>

and in code behind:

 protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == "some_command")
        {
             //what goes here to read the value of the TextBox?
        }
    }

Thanks for the fantastic product. I've been using Telerik controls for 3 years now.
Princy
Top achievements
Rank 2
 answered on 10 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?