Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
114 views
Hi all,

I'm running RAD Editor full featured on a MOSS 2007 env (RAD 5.7.1.0), and I've added some custom file extension to be allowed in the Media Manager:
<property name="MediaFilters">
   <item>*.wmv</item>
   <item>*.avi</item>
   <item>*.mpeg</item>
   <item>*.mpg</item>
   <item>*.mov</item>
   <item>*.flv</item>
   <item>*.m4v</item>
   <item>*.mp3</item>
   <item>*.mp4</item>
 </property>

I'm having troubles for some files of thoses extensions. If I upload a mp4 file, the upload works fine but after the media manager refreshes the content of my document library it does not shows my mp4 file.

And I don't have this problem for mov or flv files...

Any clue on this ?
Sandeep
Top achievements
Rank 1
 answered on 30 May 2016
1 answer
303 views

Hi,

When a document is uploaded through document manager in telerik editor, Is it possible to

              Save the document in different server shared folder path?

              Save a uploaded document in two different path at the same time ?

 

Currently we are save the uploaded files in same server as below,

                       editor.SetPaths(new string[] { "~/users/downloads"}, EditorFileTypes.Documents, EditorFileOptions.All);

 

Thanks

 

Marin Bratanov
Telerik team
 answered on 30 May 2016
1 answer
123 views

I have received the data in json format as follows:

var mydata = [
{
"Title":"My Grid Example",
"NumberOfColumns":4,
"DatasetHeader":{"items":[
{"Name":"FullName","Type":"System.String"},
{"Name":"Age","Type":"System.Int32"},
"Name":"Address","Type":"System.String"},
{"Name":"Cost","Type":"System.Double"}
]},
"Rows":["items":[
{"Rohan","12","Arab","234"},
{"Radha","11","Texas","123"},
{"Haris","22","NPL","344"},
{"Christine","23","Arab","674"},
{"Tot","22","UK","434"},
{"Terry","21","LA","334"},
{"Savana","19","SA","224"}
]}
}];

Now, I want to generate the dynamic grid with the above data with 4 columns and 7 rows (for this case) . The columns can varies during runtime (from 2-3 to 14-15)

Something like this is expected:

<script>

$(document).ready(function () {

generateGrid(mydata);

}

function generateGrid(receiveddata) {

$("#table-grid").kendoGrid({

dataSource: { data: receiveddata.Rows.Items},

height: 400,
scrollable: true,

schema: {
        model: receiveddata.DatasetHeader.items
      },

title: receiveddata.title

});

} //end of javascript function

</script>

<div id="table-grid"></div>

Konstantin Dikov
Telerik team
 answered on 30 May 2016
1 answer
141 views

Hi,

I'm having a problem with a RadEditor that I have on a RadWindow. When I set the height above about 140px, The editable part only fills up the first 140px, but the frame is the size I've defined. See that attached image for a better description than I can give.

Here's the markup:

<telerik:RadEditor ID="redLogText" runat="server" EditModes="Design"
    MaxTextLength="4000" SkinID="DefaultSetOfTools" ContentAreaMode="Div" OnClientInit="CharCountInit"
    Height="255px" Width="70%" Style="background-color: White; display: inline-block;"
    Skin="Default">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorSplitButton Name="Undo" />
            <telerik:EditorSplitButton Name="Redo" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool Name="Italic" />
            <telerik:EditorTool Name="Underline" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="JustifyLeft" />
            <telerik:EditorTool Name="JustifyRight" />
            <telerik:EditorTool Name="JustifyCenter" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorDropDown Name="FontName" />
            <telerik:EditorDropDown Name="FontSize" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="AjaxSpellCheck" />
        </telerik:EditorToolGroup>
    </Tools>
    <Modules>
        <telerik:EditorModule Name="RadEditorStatistics" Visible="true" Enabled="true"></telerik:EditorModule>
    </Modules>
</telerik:RadEditor>

 

 

Marin Bratanov
Telerik team
 answered on 30 May 2016
3 answers
377 views

Hi... I use my document management system project radasyncupload. But when upload pdf file with radasyncupload after client download pdf file has problem. When clients open pdf file Failed to load PDF document error display in screen... 

 

<telerik:RadAsyncUpload ID="doc_upload" runat="server"
                                    ChunkSize="13000" Skin="MetroTouch" MultipleFileSelection="Automatic" Width="100%" PostbackTriggers="bt_accept">
                                    <Localization Select="..." Remove="Clear" />
                                    <FileFilters>
                                        <telerik:FileFilter Extensions="zip,xls,xlsx,doc,docx,pdf,jpg" />
                                    </FileFilters>
                                </telerik:RadAsyncUpload>

Ivan Danchev
Telerik team
 answered on 30 May 2016
1 answer
237 views

I have a grid that I have setup to dynamically change the pageSize based on the window size. When the browser window size changes I call the following code:

var grid = $("#grid").data("kendoGrid");

var currentPage = grid.dataSource.page();
var currentPageSize = grid.dataSource.pageSize();

if (currentPageSize !== newPageSize) {
    grid.dataSource.pageSize(newPageSize);
}

This works fine, but I noticed that the call to .pageSize(x) triggers a POST request to the server to fetch new data. Whenever I fetch new data from the server I need to run code based on whether or not the call to the server is successful or a failure. For example, when I want to refresh this grid manually (without changing the pageSize) I call:

grid.dataSource.read().then(function () {
    doStuffOnSuccess();
}).fail(function () {
    doStuffOnFailure();
});

Unfortunately there is no promise returned from the pageSize() method that would allow me to hook into the actual result of the POST request sent. As a result I have to call both the pageSize(x) and the manual grid.dataSource.read() methods together, and this generates two POST requests that degrades performance.

Is there some way of passing a new pageSize in the grid.dataSource.read() method? Or some way of seeing if the POST request triggered by pageSize(x) was successful or failed?

Rosen
Telerik team
 answered on 30 May 2016
6 answers
763 views
If there exists any possibility to make ajax reload of one PageView from RadMultiPage without reloading content of others pages ?

For example.
I'd like to load controls to RadMultiPage only after user select the corresponding Tab. My page is look like browser with many pages. Each PageView contains <frame>.  But after new page loads content of all other's pages reloading :(.
Nencho
Telerik team
 answered on 30 May 2016
2 answers
44 views

Hello,

I am writing a number of custom shortcut commands activated by button clicks.  While the commands are firing properly, most of them are not being recognized in the undo stack - i.e. user cannot press the undo button to reverse the command.  When they do press it, they undo a command prior to running the custom command, stepping back to a document version they were not expecting.  My question is, how do I have the undo stack recognize my custom commands and allow the user to undo them?  Here's an example of a function with this issue.

            Telerik.Web.UI.Editor.CommandList["DoubleBottomBorder"] = function(commandName, editor, args) {
                         var elem = editor.getSelectedElement();
                         elem.style.borderBottom = "3px double #000000";
            };

Most of my functions are setting the style attribute of an element and are not using the pasteHtml() method (use of pasteHTML() method seems to work fine with the undo function).

Thanks,

Andrew

Andrew
Top achievements
Rank 1
 answered on 27 May 2016
2 answers
406 views

Hi,

I have a problem when I use the ajaxmanager with user control. This generate a error on JavaScript and I don't understand why?  

The first time everything is Ok, but when I press submit the page generate this issue:

Uncaught Sys.WebForms.PageRequestManagerParserErrorException: Sys.WebForms.PageRequestManagerParserErrorException: No se pudo analizar el mensaje recibido del servidor. Este error suele producirse cuando la respuesta resulta modificada por llamadas a Response.Write() o cuando los filtros de respuesta, los HttpModules o el seguimiento de servidor están habilitados.
Detalles: Error de análisis cerca de ':"text/javascript"}|
 
<!DOCTYPE html>
'.

 

I have tried placing a radajaxmanagerproxy in the user control as shown in Demo. But I always get the same result.

Any ideas?

 

Code User Control.

<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
    <style>
        .rcInputCell
        {
            padding: 0 !important;
            width: 0 !important;
        }
 
        .HiddenTextBox
        {
            width: 1px !important;
            border: 0 !important;
            margin: 0 !important;
            background: none transparent !important;
            display: none;
        }
    </style>
    <script type="text/javascript">
        function isValidDate(str) {
            var parts = str.split('/');
            if (parts.length < 3)
                return false;
            else {
                var day = parseInt(parts[0]);
                var month = parseInt(parts[1]);
                var year = parseInt(parts[2]);
                if (isNaN(day) || isNaN(month) || isNaN(year)) {
                    return false;
                }
                if (day < 1 || year < 1)
                    return false;
                if (month > 12 || month < 1)
                    return false;
                if ((month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) && day > 31)
                    return false;
                if ((month == 4 || month == 6 || month == 9 || month == 11) && day > 30)
                    return false;
                if (month == 2) {
                    if (((year % 4) == 0 && (year % 100) != 0) || ((year % 400) == 0 && (year % 100) == 0)) {
                        if (day > 29)
                            return false;
                    } else {
                        if (day > 28)
                            return false;
                    }
                }
                return true;
            }
        }
 
        function getPosition(element) {
            var xPosition = 0;
            var yPosition = 0;
            while (element) {
                xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft);
                yPosition += (element.offsetTop - element.scrollTop + element.clientTop);
                element = element.offsetParent;
            }
            return { x: xPosition, y: yPosition };
        }
    </script>
</telerik:RadScriptBlock>
<telerik:RadMaskedTextBox ID="rmtbFechaInicial" runat="server"  ClientIDMode="Static" Width="130px">
</telerik:RadMaskedTextBox>
<telerik:RadDatePicker ID="rdpFechaInicial" runat="server" Culture="es-ES" ClientIDMode ="Static" Width="30px">
    <DateInput CssClass="HiddenTextBox"></DateInput>
</telerik:RadDatePicker>

Code behind User Control

public partial class ctrlFecha : System.Web.UI.UserControl
    {
        public enum TipoDeUso
        {
            Normal,
            Periodo
        }
 
        #region Propiedades
         
        public DateTime? FechaSeleccionada
        {
            get { return rdpFechaInicial.SelectedDate; }
            set { rdpFechaInicial.SelectedDate = Convert.ToDateTime(value); }
        }
 
        private string _nombreCtrlMascara = "rmtbFechaInicial";
        public string NombreCtrlMascara { get { return _nombreCtrlMascara; } set { _nombreCtrlMascara = value; } }
 
        private string _nombreCtrlPicker = "rdpFechaInicial";
        public string NombreCtrlPicker { get { return _nombreCtrlPicker; } set { _nombreCtrlPicker = value; } }
 
        private TipoDeUso _tipoDeUso = TipoDeUso.Normal;
        public TipoDeUso TipoUso { get { return _tipoDeUso; } set { _tipoDeUso = value; } }
 
        private string _mascaraUsar = "##/##/####";
        public string MascaraUsar { get { return _mascaraUsar; } set { _mascaraUsar = value; } }
 
        private bool _usarValidacionJS = false;        ]
        public bool UsarValidacionJS { get { return _usarValidacionJS; } set { _usarValidacionJS = value; } }
         
         
        public RadMaskedTextBox CtrolMaskedTextBox { get { return rmtbFechaInicial; } set { rmtbFechaInicial = value; } }
         
        public RadDatePicker CtrolDatePicker { get { return rdpFechaInicial; } set { rdpFechaInicial = value; } }
        #endregion
 
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            rmtbFechaInicial.ID = NombreCtrlMascara;
            rmtbFechaInicial.Mask = MascaraUsar;
            rmtbFechaInicial.ClientEvents.OnBlur = "UpdateCalendar_" + NombreCtrlPicker;
 
            rdpFechaInicial.DateInput.DateFormat = TipoUso == TipoDeUso.Normal ? "dd/MM/yyyy" : "MM/yyyy";
            rdpFechaInicial.ID = NombreCtrlPicker;
            rdpFechaInicial.DatePopupButton.Attributes["OnClick"] = "Popup_" + NombreCtrlPicker + "(); return false;";
            rdpFechaInicial.ClientEvents.OnDateSelected = "UpdateTextBox_" + NombreCtrlPicker;
            if (FechaSeleccionada != null)
                rmtbFechaInicial.TextWithLiterals = Convert.ToDateTime(FechaSeleccionada).ToString(rdpFechaInicial.DateInput.DateFormat);
 
            //rdpFechaInicial.SelectedDate = FechaSeleccionada;
            rdpFechaInicial.Calendar.FastNavigationSettings.TodayButtonCaption = "Hoy";
            rdpFechaInicial.Calendar.FastNavigationSettings.OkButtonCaption = "Aceptar";
            rdpFechaInicial.Calendar.FastNavigationSettings.CancelButtonCaption = "Cancelar";
            rdpFechaInicial.DatePopupButton.ToolTip = "Abrir calendario";
 
            StringBuilder sbJS = new StringBuilder();
            sbJS.AppendLine("");
            sbJS.AppendLine("function UpdateTextBox_" + rdpFechaInicial.ID + "(sender, args) { ");
            sbJS.AppendLine("   var maskedInput = $find('" + rmtbFechaInicial.ClientID + "');");
            sbJS.AppendLine("   maskedInput.set_value(\"\");");
            sbJS.AppendLine("   var fecha = args.get_newDate();");
            sbJS.AppendLine("   var datePicker = $find('" + rdpFechaInicial.ClientID + "');");
            sbJS.AppendLine("   var date = datePicker.get_dateInput().parseDate(args.get_newDate());");
            sbJS.AppendLine("   var dateInput = datePicker.get_dateInput();");
            sbJS.AppendLine("   var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());");
            sbJS.AppendLine("   maskedInput.set_value(formattedDate);");
            sbJS.AppendLine("}");
            sbJS.AppendLine("");
            sbJS.AppendLine("function UpdateCalendar_" + rdpFechaInicial.ID + "() {");
            sbJS.AppendLine("   var maskedInput = $find('" + rmtbFechaInicial.ClientID + "');");
            sbJS.AppendLine("   var datePicker = $find(\'" + rdpFechaInicial.ClientID + "');");
            sbJS.AppendLine("   //Determinando si viene vacio");
            sbJS.AppendLine("   if (maskedInput.get_value()==\"\") { datePicker.set_selectedDate(null); return; }");
            sbJS.AppendLine("   //Determinando si es una fecha validad");
            if (TipoUso == TipoDeUso.Periodo)
            {
                sbJS.AppendLine("   var dateValid = isValidDate(\"01/\" + maskedInput.get_valueWithLiterals());");
            }
            else if (TipoUso == TipoDeUso.Normal)
            {
                sbJS.AppendLine("   var dateValid = isValidDate(maskedInput.get_valueWithLiterals());");
            }
            sbJS.AppendLine("   if (!dateValid) {");
            if (UsarValidacionJS)
            {
                sbJS.AppendLine("       var oAlert = radalert(\"Debe de ingresar una fecha valida.\", 256, 47, \"Campo requerido\", null, \"../imagenes/error1.jpg\");");
                sbJS.AppendLine("       oAlert.show();");
            }
            //sbJS.AppendLine("       maskedInput.set_value(\"\");");
            sbJS.AppendLine("       datePicker.set_selectedDate(null);");
            sbJS.AppendLine("       return;");
            sbJS.AppendLine("   }");
            if (TipoUso == TipoDeUso.Periodo)
            {
                sbJS.AppendLine("   var fecha = \"01\" + maskedInput.get_value()");
                sbJS.AppendLine("   var date = datePicker.get_dateInput().parseDate(fecha);");
            }
            else if (TipoUso == TipoDeUso.Normal)
            {
                sbJS.AppendLine("   var date = datePicker.get_dateInput().parseDate(maskedInput.get_value());");
            }
            sbJS.AppendLine("   var dateInput = datePicker.get_dateInput();");
            sbJS.AppendLine("   if (date == null) {");
            sbJS.AppendLine("       date = datePicker.get_selectedDate();");
            sbJS.AppendLine("   }");
            sbJS.AppendLine("   var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat()); ");
            sbJS.AppendLine("   datePicker.set_selectedDate(date);");
            sbJS.AppendLine("   if (!isNaN(date) && date > datePicker.get_minDate() && date < datePicker.get_maxDate()) {");
            sbJS.AppendLine("       datePicker.set_selectedDate(date);");
            sbJS.AppendLine("   }");
            sbJS.AppendLine("   else {");
            sbJS.AppendLine("       var oldSelectedDate = datePicker.get_selectedDate();");
            sbJS.AppendLine("       if (oldSelectedDate == null) return;");
            sbJS.AppendLine("       if (oldSelectedDate.toString() == datePicker.get_minDate().toString()) {");
            sbJS.AppendLine("           maskedInput.set_value(\"\");");
            sbJS.AppendLine("       }");
            sbJS.AppendLine("       else {");
            sbJS.AppendLine("           maskedInput.set_value(DateToString(oldSelectedDate));");
            sbJS.AppendLine("          }");
            sbJS.AppendLine("   }");
            sbJS.AppendLine("}");
            sbJS.AppendLine("");
            sbJS.AppendLine("function Popup_" + rdpFechaInicial.ID + "() {");
            sbJS.AppendLine("   var datePicker = $find('" + rdpFechaInicial.ClientID + "');");
            sbJS.AppendLine("   var maskedInput = $find('" + rmtbFechaInicial.ClientID + "');");
            sbJS.AppendLine("   var textBox = datePicker.get_textBox();");
            sbJS.AppendLine("   var position = getPosition(maskedInput._textBoxElement);");
            sbJS.AppendLine("   var popupElement = datePicker.get_popupContainer();");
            sbJS.AppendLine("   datePicker.showPopup(position.x, position.y + maskedInput._textBoxElement.offsetHeight);");
            sbJS.AppendLine("}");
 
            ScriptManager.RegisterStartupScript(Page, typeof(Page), rdpFechaInicial.ID.ToString(), sbJS.ToString(), true);
            //}
        }
    }

Code page .aspx

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>           
            <telerik:AjaxSetting AjaxControlID="btnconsultar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divContenido" LoadingPanelID="ralpCasos"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>           
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="ralpCasos" runat="server"></telerik:RadAjaxLoadingPanel>
 
 
    <div class="row" id="divContenido" runat="server">
        <div class="col-xs-12">
            <div class="panel panel-info" style="margin-left: 10px; margin-right: 10px;">
                <table class="table" border="0">                       
                    <tr>
                        <td style="width: 60px;"></td>
                        <td style="width: 100px; vertical-align: middle;">
                            <asp:Label ID="lblFechaInicial" runat="server" Font-Size="14px" Text="Desde"></asp:Label>
                        </td>
                        <td>
                            <uc1:ctrlFecha runat="server"
                                ID="ctrlFecha"
                                MascaraUsar="##/##/####"
                                NombreCtrlMascara="rmtbFechIni"
                                NombreCtrlPicker="rdpFechIni"
                                TipoUso="Normal" UsarValidacionJS="false" />
                            <asp:Label ID="lbErrorFechaIni" runat="server"></asp:Label>
                        </td>
                        <td></td>
                        <td style="width: 100px; vertical-align: middle;">
                            <asp:Label ID="lblFechaFinal" runat="server" Font-Size="14px" Text="Hasta"></asp:Label>
                        </td>
                        <td>
                            <uc1:ctrlFecha runat="server"
                                ID="ctrlFecha1"
                                MascaraUsar="##/##/####"
                                NombreCtrlMascara="rmtbFechaFinCasos"
                                NombreCtrlPicker="rdpFechaFinCasos"
                                TipoUso="Normal" UsarValidacionJS="false" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 60px;"></td>
                        <td style="width: 100px; vertical-align: middle;">
                            <asp:Label ID="Label1" runat="server" Text="Buscar por"></asp:Label>
                        </td>
                        <td colspan="2">
                            <telerik:RadTextBox runat="server" ID="txtBusqueda"
                                Width="100%" EmptyMessage="No. Caso, Título, Solicitante, Usuario asignado o seguidor...">
                            </telerik:RadTextBox>
                        </td>
                        <td colspan="2" style="text-align: right; padding-right: 100px;">
                            <telerik:RadButton ID="btnconsultar" runat="server"  OnClick="btnconsultar_Click" Style="display: inline-block !important;" Text="Consultar">
                                <Icon PrimaryIconUrl="../imagenes/buscar.png" />
                            </telerik:RadButton>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5">
                            <asp:Label runat="server" ID="lbMostrarErrores" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

Thanks for your help.

Melvin
Top achievements
Rank 1
 answered on 27 May 2016
1 answer
139 views

I've read a number of articles about this and thought I took the necessary steps to correct it, but it still isn't working.

I've got a RadWindow with a number of controls defined on it that are all in the same ValidationGroup. On the button to save the stuff I've specified:

ValidationGroup="attachmentValidations"

When I do this my data is saved, but the RadWindow will not close.

If I remove the above and add:

CausesValidation="true"

It will close the window, but doesn't appear to do any validation.

I've added the following lines per your help article:

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />

Still no luck. Any help would be appreciated.

 

Rodney

 

 

 

 

Marin Bratanov
Telerik team
 answered on 27 May 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?