Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
129 views
Hi there,
  I am using a RadEditor with an ImageManager. This worked fine when specifying paths relative to the application:
<ImageManager ViewPaths='/blogUpload/postimage/' DeletePaths='/blogUpload/postimage/'
                            UploadPaths='/blogUpload/postimage/' MaxUploadFileSize="6553600" />

But I'm unable to get it working again after I moved the site to a load-balanced environment which has a shared location for file uploads "E:\SharedFiles" 

The following syntax doesn't allow image uploads and gives 404 errors on other buttons within the ImageManager

                string[] viewImages = new string[] { "/blogupload/postimage/" };
                string[] uploadImages = new string[] { @"E:\SharedFiles\blogupload\postimage"};
                string[] deleteImages = new string[] { @"E:\SharedFiles\blogupload\postimage"};
                RadEditorContent.ImageManager.ViewPaths = viewImages;                 RadEditorContent.ImageManager.UploadPaths = uploadImages;                 RadEditorContent.ImageManager.DeletePaths = deleteImages;                 RadEditorContent.ImageManager.MaxUploadFileSize = 6553600;

I've based the above approach from this page

Is there something wrong with how I'm approaching this? The above code doesn't even work on my local machine with "C:\folder\folder\" for uploadImages and deleteImages

Dobromir
Telerik team
 answered on 30 Aug 2012
0 answers
44 views
Hello,

when I try to set a date for RadTimePicker on my page load, I get the JS error: "_dateIput is null".
RadTimePicker is a subcontrol of another IScriptControl, and it is created programmatically in its OnInit function.

I guess that situation is similar to this thread but I can't see an answer in it.
So, my question is: when _dateInput is created and how could I access it from JS on my page load?

If it matters, I'm using Telerik AJAX controls version 2010.3.1109.

Thanks in advance,
Ilya.
Seekbirdy
Top achievements
Rank 1
 asked on 30 Aug 2012
5 answers
130 views
Dear Telerik,

We are experiencing a strange thing with the RadGrid. We have set up a RadGrid clientside, all clientside. Paging, Adding and Deleting are done clientside.

What we come across is that every second time we Delete a row(by calling the deleteCustomer function) the  masterTable.deleteSelectedItems(); is not executed. But the console.log just above it is executed so it makes it too that function each time you want to delete an item.
The basic idea of deleting these items is that when a row is selected, an javascript array is filled with IDs and when the deleteCustomer function is executed, it fires an ajax call to the webservice to do database updates. And after waiting for the result to come back, it deletes the row from the grid.

Is there a bug in the RadGrid that makes it unavailable for a small time or are we not implementing this correctly?
I have put the RadGrid and Jquery code beneath.

By the way, we also used masterTable.rebind function instead of the deleteSelectedItems but that has the same effect.

Thank you for your time.

Vincent

<telerik:RadGrid ID="AudienceRecipientsGrid" runat="server" Width="695" AllowPaging="True" PageSize="15" AutoGenerateColumns="false" AllowMultiRowSelection="true" >
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    <MasterTableView TableLayout="Fixed" DataKeyNames="CustomerID" ClientDataKeyNames="CustomerID">
        <Columns>
            <telerik:GridBoundColumn DataField="CustomerID" DataType="System.Int32" FilterControlAltText="Filter CustomerID column" HeaderText="CustomerID" SortExpression="CustomerID" UniqueName="CustomerID" Visible="False" ReadOnly="True"></telerik:GridBoundColumn>
            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="6%" ItemStyle-Width="6%">
                    <HeaderStyle Width="6%"></HeaderStyle>
                    <ItemStyle Width="6%"></ItemStyle>
                </telerik:GridClientSelectColumn>
            <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Voornaam" SortExpression="Name" UniqueName="Name"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SurName" FilterControlAltText="Filter SurName column" HeaderText="Achternaam" SortExpression="SurName" UniqueName="SurName"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Email" FilterControlAltText="Filter Email column" HeaderText="E-mail" SortExpression="Email" UniqueName="Email"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="joindate" DataType="System.DateTime" FilterControlAltText="Filter joindate column" HeaderText="Inschrijfdatum" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" UniqueName="joindate" ReadOnly="true" ></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
        <Scrolling AllowScroll="False" EnableVirtualScrollPaging="True" UseStaticHeaders="True"></Scrolling>
        <DataBinding Location="~/ems/EMSWS.asmx" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows"></DataBinding>
        <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowDeselected" OnRowCreated="RowCreated" OnRowDataBound="RowDataBound" />
    </ClientSettings>
    <PagerStyle Mode="NumericPages" />   
    <FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
<span onclick="deleteCustomers()" class="cms_hyperlink">Ontvangers verwijderen</span>

All grid logic is done here:
//Grid logic
var selected = {};
function RowSelected(sender, args) {
    var customerID = args.getDataKeyValue("CustomerID");
    if (!selected[customerID]) {
        selected[customerID] = customerID;
    }
}
function RowDataBound(sender, args) {
    //Every time a new page is loaded, all rows are unselected....
    var customerID = args.get_dataItem()["CustomerID"];
    if (selected[customerID]) {
        args.get_item().set_selected(true);
    }
    else {
        args.get_item().set_selected(false);
    }
}
function RowDeselected(sender, args) {
    var customerID = args.getDataKeyValue("CustomerID");
    if (selected[customerID]) {
        selected[customerID] = null;
    }
}
function RowCreated(sender, args) {
    var customerID = args.getDataKeyValue("CustomerID");
    if (selected[customerID]) {
        args.get_gridDataItem().set_selected(true);
    }
}
 
//Deleting customers
function deleteCustomers() {
    WSdeleteCustomers();
}
function WSdeleteCustomers() {
    var dfd = new jQuery.Deferred();
    $.ajax({
        type: 'POST',
        url: "/ems/emsws.asmx/RemoveEmailFromAudience",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        data: "{ 'strCustomerIDs': '" + GetSelectedCustomers() + "', 'iAudienceID': '" + getParameterByName('id') + "' }",
        cache: false,
        success: function (data) {
            dfd.resolve();
        }
    }).done(function () {
        dfd.promise();
    }).pipe(function () {
        reloadGridAfterDelete();
    });
}
function GetSelectedCustomers() {
    var allids = '';
    var grid = $find("<%=AudienceRecipientsGrid.ClientID %>");
    var MasterTable = grid.get_masterTableView();
    var selectedRows = MasterTable.get_selectedItems();
    for (var i in selected) {
        allids = allids + i + ',';
    }
    return allids;
}
 
function reloadGridAfterDelete() {
    //console.log("reload grid");
    var masterTable = window.$find("<%= AudienceRecipientsGrid.ClientID %>").get_masterTableView();
    //masterTable.rebind();
    console.log("deleteSelectedItems()");
    masterTable.deleteSelectedItems();
    }







Antonio Stoilkov
Telerik team
 answered on 30 Aug 2012
1 answer
159 views
Dear Sir/Madam


Problem 1 : Inside Password Field How to show Error Text
==========================================
I have TextBox which accept Password as Input 
I want to validate 
1)Must be Required Field
2)Minimum Password Characters is 6.If user enters password less than 6.
I want to show Error Message Inside Password Textbox(Min.6 Chracters like that)


How to do above using RadInputManager?


I  set  Empty Message and ErrorMessage for Password Textbox.But it is doesn't works


Becoz Having TextMode=Password show Required Text in the form of Bullets


I want to show Error Message inside TextBox with effects similar to RadNumeric Text




My ASPX
========
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
    <div>
    <span>Password&nbsp;:&nbsp;</span>
   
    <asp:TextBox ID="txtpwd" runat="server" TextMode="Password" Width="150px" Height="20px"></asp:TextBox>
     </div>
       <telerik:RadInputManager ID="RadInputManager1" runat="server">
     <telerik:TextBoxSetting BehaviorID="PasswordBehavior" EmptyMessage="Password" ErrorMessage="Required"  Validation-IsRequired="true" >
   
    <TargetControls><telerik:TargetInput ControlID="txtpwd" /></TargetControls>
 
     <PasswordStrengthSettings ShowIndicator="true"  RequiresUpperAndLowerCaseCharacters="False" PreferredPasswordLength="6" MinimumUpperCaseCharacters="0" MinimumSymbolCharacters="0" MinimumNumericCharacters="0" MinimumLowerCaseCharacters="0" />
    </telerik:TextBoxSetting>
    </telerik:RadInputManager>
   
    </form>


==========================================




With Regards,
Maha 
Kostadin
Telerik team
 answered on 30 Aug 2012
1 answer
129 views
Problem 1 : How to use validate custom JavaScript Function using RadInputManager
==========================================================
I have TextBox which accept Email Id as Input 
I want to validate following 


V1)Must be Required Field
V2)Must be valid Email Id
V3)Domain Part should not matched with gmail.com or yahoo.com etc
V4)I want to check that email id in DataBase(Already registerd id or not)


The above V1 and V2  i can achieve using 


Validation-IsRequired="true"  ValidationExpression="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" ErrorMessage="Invalid Email"


But instead of your code i want to validate using My JavaScript Code


Current Now i'm displaying Error Message in Label


But I want to show my Error Message inside TextBox


I don't know how to get BehaviorID of txtemailid(textbox) and How i set My Custom Error Message inside TextBox


I.e How can i access Validation-IsRequired and ErrorMessage Properties using script?


Also As I mentioned Earlier I want to check that email id in DataBase(Already registerd id or not)..How can i achieve this using RadInputManager


Please solve my problem..Thank You


My ASPX
========
<form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />


    <div>
      <div id="divemail">
            <div style="width:150px; float:left; font-weight:bold;"><span style="color:Red;">*</span>&nbsp;Email Id</div>
            <div>
            <div style=" width:235px; float:left;">
          <asp:TextBox ID="txtemailid" Width="150px" runat="server"></asp:TextBox>
              
              </div></div>
            <div style=" float:left; height:10px; padding-left:10px;"> 
                <asp:Label ID="lblemail" runat="server" ForeColor="#CC0000"></asp:Label> 
            
            </div>
        </div>
    </div>
    
    
    
    <telerik:RadInputManager ID="RadInputManager1" runat="server">
    
    
   <telerik:RegExpTextBoxSetting ClientEvents-OnBlur="EmailValidate" BehaviorID="Regexemailid" runat="server" EmptyMessage="Email Id">
   <TargetControls><telerik:TargetInput  ControlID="txtemailid"/></TargetControls>
   




   
    </telerik:RegExpTextBoxSetting>
   </telerik:RadInputManager>
   
   </form>
    <script type="text/javascript" language="javascript">


        function EmailValidate(sender, eventArgs) {
           
            document.getElementById('lblemail').innerHTML = "";
            var emailid = eventArgs.get_targetInput().get_value();
          
            if (emailid.length == 0)
            {
                document.getElementById('lblemail').innerHTML = "Required";


                args.IsValid = false;
            }
            //Invalid Email id
            else if (emailid.length > 0 && emailid.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
            {
                document.getElementById('lblemail').innerHTML = "Invalid Email ID";
                args.IsValid = false;
            }
            //This block has only Valid Email Ids--We have to check that domain
            else if (emailid.length > 0 && emailid.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
            {  
               var domain = emailid.toLowerCase();
                   domain = domain.substring(emailid.indexOf("@") + 1, emailid.length);
               if (domain == "yahoo.co.in" || domain == "gmail.com") {
                        document.getElementById('lblemail').innerHTML = "This Domain (" + domain + ") has been Blocked.Please choose different Email Id";                      
                 }
                args.IsValid = false;
            }
      


        }
        
    
    </script>




==========================================


With Regards,
Maha
Tsvetina
Telerik team
 answered on 30 Aug 2012
3 answers
127 views
Hi All,

I am using a RadComboBox with checkboxes and I want to get its checked item on button click. For this I am using CheckedItems property of combo box.

I am correctly getting the checked items if I use the combo box outside a RadGrid, but when I use the same combo box inside a RadGrid, I am not getting any checked items (count=0). I can correctly get the text of combo box, but cannot understand what is problem with getting the checked items.

Please help!!! Thanks in advance...

Dhaval
Ivana
Telerik team
 answered on 30 Aug 2012
1 answer
131 views
hi this is the structure of my page..
loading panel is working fine in Chrome and IE8.
but in FireFox page is not completely loaded but the loading image vanished.

<asp:Content ID="Content4" ContentPlaceHolderID="PageCenterContent" runat="server">
  
   <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
        function pageLoad(sender, eventArgs) {
        
              if (!eventArgs.get_isPartialLoad()) {
                var myAjaxControl = <%= RadAjaxManager1.ClientID %>;
                    myAjaxControl.ajaxRequest();
               }
          
        }
        
     

     function OnResponseEnd(sender, eventArgs)
        {      
           var currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");
            var currentUpdatedControl = "ctl00_PageCenterContent_Radpanebottom";
            currentLoadingPanel.hide(currentUpdatedControl);
              
        }

        function OnRequestStart(sender, eventArgs)
        {
            var currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");
            var currentUpdatedControl = "ctl00_PageCenterContent_Radpanebottom";
            currentLoadingPanel.show(currentUpdatedControl);
        
        }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
         ClientEvents-OnRequestStart="OnRequestStart"
        ClientEvents-OnResponseEnd="OnResponseEnd" onajaxrequest="RadAjaxManager1_AjaxRequest1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Web20" IsSticky="false"
        Height="220px">
    </telerik:RadAjaxLoadingPanel>
    <%-- start RadSplitterContent--%>
    <telerik:RadSplitter ID="radSplitterContent" runat="server" Skin="WebBlue" LiveResize="True"
        Width="95%" CssClass="marginAuto" Height="720">
        <%-- start RadPaneSensorBar--%>
      
        <telerik:RadPane ID="RadPaneSensorBar" runat="server" Height="100%" Width="272" MaxWidth="265">
          <fieldset class="Sensorgrp">
           <legend style="text-align:left;">Sensor Group</legend>
            <telerik:RadPanelBar ID="sensorPanelBar" runat="server" ExpandMode="SingleExpandedItem"
                Skin="WebBlue" OnItemClick="sensorPanelBar_ItemClick" OnItemDataBound="sensorPanelBar_ItemDataBound">
            </telerik:RadPanelBar>
            </fieldset>
        </telerik:RadPane>
        <%-- End RadPaneSensorBar--%>
      
        <%-- start RadpaneMid--%>

        <telerik:RadPane ID="RadpaneMid" runat="server" Scrolling="None" Height="700" Width="720">
            <%-- start RadsplitterMid--%>
           

            <telerik:RadSplitter ID="RadsplitterMid" runat="server" Orientation="Horizontal" Width="680" >
                <%-- start RadPaneRotator--%>
                
                <telerik:RadPane ID="RadPaneRotator" runat="server" Scrolling="None" Height="75" Width="680">
                 <fieldset style=" height:59px; width: 697px;">
              <legend style="text-align:left;">Sensors</legend>
            
                    <telerik:RadRotator ID="SensorRadRotator" runat="server" ScrollDuration="2000" RotatorType="Buttons"
                        Height="50px" ItemHeight="20px" Width="590px" ItemWidth="200px" CssClass="marginAuto boarderNone"
                        Skin="MetroTouch" OnItemDataBound="SensorRadRotator_ItemDataBound"
                         OnItemClick="SensorRadRotator_ItemClick1">
                        <ItemTemplate>
                            <div class="product bgpurple" runat="server" id="Product">
                                <div class="productleft" runat="server" id="productleft">
                                <asp:Image ID="StatusImg" runat="server" ImageUrl="~/Images/play-icone-6427-16.png" />
                                 
                                </div>
                                <div class="productright">
                                    <asp:Label ID="lblName" runat="server" Style="color: white; float: left; font-weight: bold;"></asp:Label>
                                    <asp:HiddenField ID="hdnSensorId" runat="server" />
                                    <br />
                                    <asp:Label ID="lblStatus" runat="server" Style="color: white; float: left;"></asp:Label>
                                </div>
                            </div>
                        </ItemTemplate>
                    </telerik:RadRotator>
                       </fieldset>         
                </telerik:RadPane>
               
 
                <%-- end RadPaneRotator--%>
                <%-- start Radpanebottom--%>
                <telerik:RadPane ID="Radpanebottom" runat="server" Scrolling="none" Height="650">
                </telerik:RadPane>
                <%-- end Radpanebottom--%>
            </telerik:RadSplitter>                          
               
            <%-- End RadsplitterMid--%>
        </telerik:RadPane>
        <%-- End RadpaneMid--%>
    </telerik:RadSplitter>
    <%-- End  RadSplitterContent--%>

   
                    
</asp:Content>



Eyup
Telerik team
 answered on 30 Aug 2012
3 answers
92 views
Hi all,
How to persistence the selected row of file explorer during the sorting and paging of telelrik file explorer grid.
I detected  TELERIKs new version have  already build in functionality of persistence the selected row during the sorting and paging. i am using DOTNETNUKE 6.1.5 and telelrik version is -2012.1.411.35,
is there any version problem ? or how can i do this ...
Dobromir
Telerik team
 answered on 30 Aug 2012
1 answer
104 views
Hello,

How to get client id of all date picker control on a page using javascript like the way we can get array of rad comboboxes


teleric.web.ui.Radcombobox.comboboxes[i]...

so is there any way to get clientid/array of date picker control


thanks,
Nilesh 
Eyup
Telerik team
 answered on 30 Aug 2012
21 answers
531 views
I've set the style of the empty message to:
<EmptyMessageStyle Font-Italic="True" ForeColor="#999999" /> 
when hovering over the textbox, however, this style is lost and it reverts to it's default font.  Is there something else I need to set or is this a defect?

Respectfully,

Jeff Beem
Vasil
Telerik team
 answered on 30 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?