Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
132 views
I've found that if I set a paragraph style like so in my toolsfile that it doesn't even apply it.

<paragraph name="Clear Formatting" value="&lt;span&gt;" />

Why is that, if I change it to the "<P>" element it works, but if it's not some sort of block element it doesn't work. Also, I tried to set it to "<body>", like the demo's on the site show, but they don't work.

The reason I want to use span is because I want to remove the header tags applied to the text and turn them into inline elements, is it just not possible or is this some issue with the RadEditor control. I'm using version 2009.3.1314.20.

Thanks.
Rumen
Telerik team
 answered on 31 Mar 2010
3 answers
154 views
In my timepicker whenever I edit values manually and try to save the changes and check it on the client side,  it does not take the changed value and adheres to the previous value...
Am I missing some property here? 

I am currently using this time picker:

<

 

Rad:RadTimePicker ID="RadTimeClaimReported" EnableViewState="false" runat="server"

 

 

Width="85px" TabIndex="8" MinDate="1000-01-01" OnValueChanged="onDateTimeSelected" >

 

 

<DateInput runat="server" DateFormat="hh:mm tt" TabIndex="8" Width="80px" />

 

 

<ClientEvents OnPopupClosing="onDateTimeSelected" />

 

 

<TimeView runat="server" TimeFormat="hh:mm tt" TabIndex="8" />

 

 

<TimePopupButton TabIndex="8" />

 

 

</Rad:RadTimePicker>

onDateTimeSelected(sender, e)
{

 

 

var textbox = sender.get_dateInput();

 

 

if(textbox.get_enabled())

 

textbox.focus();

}


Regards
Arun


 

Radoslav
Telerik team
 answered on 31 Mar 2010
1 answer
106 views
Hi,

I ran into this problem wherein my RadEditor does not render properly and the text area remains disabled.

I have two usercontrols : UC1 and UC2 on my page. When my page initially loads, only UC1 is visible. UC2, which has the RadEditor control, remains invisible when the page first loads. Upon clicking a button UC2 is set to visible via an Ajax callback, which is set via AjaxSettings with RadAjaxManager.
Whether the ajaxSettings are set in design mode or programmatically, it didn't make any difference in the behaviour of RadEditor. The RadEditor loads, toolbar loads, but the content is never displayed and remains disabled. When I check the html rendered using Firebug, I can see that the iFrame portion of the RadEditor is missing when ajaxSettings are present on the page. However, if the AjaxSettings are removed, everything works fine except that the controls are no longer ajaxified but have to postback to get/update the data.

I tried it in IE as well without any luck :( . Tried setting the AjaxSettings in PreRender ..no luck though. Tried loading/adding RadEditor programmatically and met the same luck.

Any suggestions would be appreciated.

Thanks,
Pravs
Rumen
Telerik team
 answered on 31 Mar 2010
1 answer
63 views
Hi,

I ran into this problem wherein my RadEditor (used from RadControls_for_ASP.NET_AJAX_2008_1_619_dev) does not render properly and the text area remains disabled.

I have two usercontrols : UC1 and UC2 on my page. When my page initially loads, only UC1 is visible. UC2, which has the RadEditor control, remains invisible when the page first loads. Upon clicking a button UC2 is set to visible via an Ajax callback, which is set via AjaxSettings with RadAjaxManager.
Whether the ajaxSettings are set in design mode or programmatically, it didn't make any difference in the behaviour of RadEditor. The RadEditor loads, toolbar loads, but the content is never displayed and remains disabled. When I check the html rendered using Firebug, I can see that the iFrame portion of the RadEditor is missing when ajaxSettings are present on the page. However, if the AjaxSettings are removed, everything works fine except that the controls are no longer ajaxified but have to postback to get/update the data.

I tried it in IE as well without any luck :( . Tried setting the AjaxSettings in PreRender ..no luck though. Tried loading/adding RadEditor programmatically and met the same luck.

Any suggestions would be appreciated.

Thanks
Rumen
Telerik team
 answered on 31 Mar 2010
1 answer
207 views
I tried the following in my Page_Load event based on search in forum:
protected void Page_Load(object sender, EventArgs e)
{
    ...
    // make call to get data
    List<QMarkRow> qmarkRows = qmd.getData(
        sessFilter,
        sessSort,
        pageSize);

    // set datasource
    grdList.DataSource = qmarkRows;
    grdList.VirtualItemCount = qmd.Count;
    grdList.PageSize = pageSize;
    grdList.CurrentPageIndex = qmd.PageIndex;
    grdList.DataBind();
    // tried below in GrdList_PreRender event still error
    if (sessSort != null && sessSort.Length > 0)
    {
        // create GridSortExpression and add to grid
        // format of sessSort: Sort<Coln> <ASC|DESC>
        GridSortExpression gse = new GridSortExpression();
        int index = sessSort.IndexOf(" ");
        gse.FieldName = sessSort.Substring(4, index - 4);
        gse.SortOrder = sessSort.Substring(index + 1).Equals("ASC") ? GridSortOrder.Ascending : GridSortOrder.Descending;
        grdList.MasterTableView.SortExpressions.Add(gse);
        grdList.MasterTableView.Rebind();
    }
...
}
I get error on Rebind() call:
IndexOutOfRangeException was unhandled by user code
cannot find column Col1

Col1 is defined in grid:
<telerik:RadGrid
        ID="grdList" runat="server"
        EnableViewState="false"
        Height="328px"
        AllowPaging="true"
        AllowCustomPaging="true"
        AllowSorting="true"
        AllowFilteringByColumn="true"
        AutoGenerateColumns="False"
        PageSize="12"
        Skin="WebBlue" OnPreRender="GrdList_PreRender">
    <MasterTableView
            ClientDataKeyNames="Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10"
            EnableViewState="False">
        <Columns>
            <telerik:GridBoundColumn DataField="Col1" UniqueName="Col1"
                DataType="System.String"
                HeaderText="COL1" Visible="false" DataFormatString="<nobr>{0}</nobr>" >
                <HeaderStyle Width="80px" HorizontalAlign="left"  />
                <ItemStyle Width="80px" HorizontalAlign="left" />
            </telerik:GridBoundColumn>                        
...

This grid is defined in user control and everything else works except setting sortExpression.
Pavlina
Telerik team
 answered on 31 Mar 2010
5 answers
176 views
Hi,

I am having a problem with the Radupload functionality in relation to the Clear button and custom fields; when I click on the clear button the control removes itself and creates a new version but it does not seem to remove the previous instance of the custom field resulting in two copies of the field after the clear is complete.  I used a Javascript example I found on this forum to add the custom field in the "OnClientAdded" event handler, but I guess the example is missing the cleanup logic.  I included placeholders for the OnClientClearing and OnClientDeleting event handlers ready for some logic :-)
Below is the code, can you help please?

Explanation:  the RadUpload control is being used within a grid that displays a list of document placeholders, when the document does not have an attached document, the RadUpload control is displayed, otherwise it is hidden and disabled.  Documents' Streams are being uploaded to a database using the dynamic property docid and docbarcode.  BTW, there is a save button above the grid (not displayed in code) that causes a full page postback.

Thank you
Ali M.

UploadDocuments.aspx
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="false" GridLines="None" 
    Width="100%" Height="500px" AllowSorting="true" EnableAjaxSkinRendering="true" 
    EnableViewState="true" AutoGenerateColumns="false"
    <MasterTableView AllowAutomaticUpdates="true" AutoGenerateColumns="false" AllowCustomSorting="true" 
        AllowNaturalSort="false" NoMasterRecordsText="This item has no documents"
            <Columns> 
                <telerik:GridBoundColumn UniqueName="DocumentID" DataField="DocumentID" HeaderText="ID" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="Barcode" DataField="Barcode" HeaderText="Barcode" Display="true" ItemStyle-Width="110px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="Type" DataField="Type" HeaderText="Document Type" Display="true" ItemStyle-Width="200px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="FolderID" DataField="ID" HeaderText="FolderID" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="ReceivedOn" DataField="Received On" HeaderText="Received On" Display="true" ItemStyle-Width="70px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="LinkedOn" DataField="Linked On" HeaderText="Linked On" Display="true" ItemStyle-Width="70px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="FileType" DataField="File Type" HeaderText="File Type" Display="true" ItemStyle-Width="130px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="eDocSource" DataField="eDocSource" HeaderText="eDocSource" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn UniqueName="Ref1" DataField="Ref1" HeaderText="Ref1" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridCheckBoxColumn UniqueName="Linked" DataField="Linked" HeaderText="Linked" Display="false"></telerik:GridCheckBoxColumn> 
                <telerik:GridTemplateColumn UniqueName="doclink" ItemStyle-Width="300px"
                    <ItemTemplate> 
                        <telerik:RadUpload ID="RadUpload1" runat="server" MaxFileInputsCount="1" RegisterWithScriptManager="true" 
                                TargetFolder="" OnValidatingFile="RadUpload1_ValidatingFile" EnableFileInputSkinning="true" 
                                ControlObjectsVisibility="RemoveButtons" Visible='<%# IIf(DataBinder.Eval(Container.DataItem, "Linked"), false, true) %>' 
                                Enabled='<%# IIf(DataBinder.Eval(Container.DataItem, "Linked"), false, true) %>' 
                                docid='<%# DataBinder.Eval(Container.DataItem, "DocumentID") %>' InputSize="25" 
                                docbarcode='<%# DataBinder.Eval(Container.DataItem, "Barcode") %>' 
                                OnClientAdded="OnClientAddedHandler" OnClientDeleting="OnClientDeleting" OnClientClearing="uploadFileClearing" 
                                OnClientFileSelected="uploadFileSelected"
                        </telerik:RadUpload> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
    </MasterTableView> 
    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false"
            <Scrolling AllowScroll="true" /> 
            <Selecting AllowRowSelect="true" /> 
            <ClientEvents OnRowCreating="radDummy" OnRowCreated="radDummy" /> 
    </ClientSettings> 
</telerik:RadGrid> 


UploadDocuments.aspx.vb
'*** some validation here - removed from example 
Try 
    _sDocid = TryCast(sender, Telerik.Web.UI.RadUpload).Attributes.Item("docid"
Catch ex1 As Exception 
    _isValid = False 
End Try 
If Not _isValid Then 
    '** deal with invalid upload 
    Return 
End If 
Try 
    _barcode = TryCast(sender, Telerik.Web.UI.RadUpload).Attributes.Item("docbarcode"
Catch ex1 As Exception 
    _isValid = False 
End Try 
If Not _isValid Then 
    '** deal with invalid upload 
    Return 
End If 
 
Try 
    _docName = e.UploadedFile.GetFieldValue("Name"
    _docName = _docName.Trim() 
Catch ex1 As Exception 
    _docName = "" 
End Try 
 
If _docName.Length = 0 Then 
    _docName = String.Format("Document [{0}]", _barcode) 
End If 
 
'** process the upload 
'** -- code removed from example 


uploaddocuments.js
var numberOfCustomFields = 0; 
function OnClientAddedHandler(sender, eventArgs) { 
  var inputRow = eventArgs.get_row(); 
  var uList = inputRow.parentNode; 
  var count = 0; 
 
  // add a new row for a Title field 
  newRow = document.createElement("li"); 
  count++; 
  uList.insertBefore(newRow, inputRow); 
  var label = document.createElement("span"); 
  label.innerHTML = "Name : "
  label.style.width = "150px"
  label.style.fontSize = "10pt"
  label.style.fontWeight = "bold"
  input = document.createElement("input"); 
  input.type = "text"
  input.style.width = "200px"
  input.id = input.name = sender.getID("Name"); 
  newRow.appendChild(label); 
  newRow.appendChild(input); 
 
  //add a File label in front of the file input 
  var fileInputSpan = inputRow.getElementsByTagName("span")[0]; 
  label = document.createElement("span"); 
  label.innerHTML = "File :&nbsp;&nbsp;&nbsp;&nbsp;"
  label.style.width = "150px"
  label.style.fontSize = "10pt"
  label.style.fontWeight = "bold"
  label.style.verticalAlign = "middle"
  label.style.paddingTop = "5px"
  inputRow.insertBefore(label, fileInputSpan); 
  numberOfCustomFields = count; 
}; 
 
function uploadFileClearing(sender, eventArgs) { 
}; 
 
function OnClientDeleting(sender, eventArgs) { 
}; 







Genady Sergeev
Telerik team
 answered on 31 Mar 2010
2 answers
159 views
Hi,

 We are facing an weird problem. We have a RadCaptcha inside an asp:login template and have one RadPanel where this asp:login is inside.
 When the Captcha Generate New Machine is asked for, them an AJAX request is started but the interesting is the return: no image at all, captcha is there but the div's responsible for the images are not.
 Sample code:

    <form id="frmLogin" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"   
            HttpHandlerUrl="~/SBP.UI.WebResource.axd">  
    </telerik:RadScriptManager> 
    <div id="login" align="center">  
<div style="position:absolute; left:0; right:0; top:0; height:35px; background-color:#d9d9d9; text-align:center">  
    <img src="/App_Themes/login/logo_sbp.png" width="93" height="35" /> 
 
</div> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Black">  
        </telerik:RadAjaxLoadingPanel> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"   
            DefaultLoadingPanelID="RadAjaxLoadingPanel1">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="LogOnSBP">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="LogOnSBP"   
                            LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelRenderMode="Inline" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxPanel ID="rpLogin" runat="server">  
            <asp:Login ID="LogOnSBP" runat="server"   
                FailureText="Acesso negado" FailureTextStyle-CssClass="falhaAcesso" Orientation="Horizontal" 
                LoginButtonText="Entrar"   
                OnAuthenticate="LogOn1_Authenticate" PasswordLabelText="Senha:" 
                PasswordRequiredErrorMessage="Pass required"   
                TitleText="" UserNameLabelText="Login:"   
                UserNameRequiredErrorMessage="User required"   
                VisibleWhenLoggedIn="False" DestinationPageUrl="~/Default.aspx"   
                DisplayRememberMe="False" > 
                <CheckBoxStyle HorizontalAlign="Left" /> 
                <LoginButtonStyle CssClass="btLogin" /> 
                <LayoutTemplate> 
                    <table border="0" cellpadding="1" cellspacing="0"   
                        style="border-collapse:collapse;">  
                        <tr> 
                            <td> 
                                <table border="0" cellpadding="0">  
                                    <tr> 
                                        <td align="left">  
                                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"><asp:RequiredFieldValidator CssClass="erroFail" ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User required" ToolTip="Usuário necessário" ValidationGroup="LogOnSBP">*</asp:RequiredFieldValidator> Login:</asp:Label>   
                                            <asp:TextBox CssClass="tiLogin" ID="UserName" runat="server"></asp:TextBox> 
                                        </td> 
                                        <td align="left" style=" padding-left:10px;">  
                                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password"><asp:RequiredFieldValidator CssClass="erroFail" ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Pass required" ToolTip="Senha necessária" ValidationGroup="LogOnSBP">*</asp:RequiredFieldValidator> Senha:</asp:Label> 
                                            <asp:TextBox CssClass="tiSenha" ID="Password" runat="server" TextMode="Password"></asp:TextBox> 
                                              
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <td style="width:180px; position:relative; height:80px;">  
                                            <telerik:RadCaptcha ID="rcBotProtection" runat="server"   
                                                ProtectionMode="InvisibleTextBox">  
                                            </telerik:RadCaptcha> 
                                              
                                            <telerik:RadCaptcha ID="rcCaptcha"  runat="server"  CaptchaLinkButtonText=""   
                                                ValidatedTextBoxID="txtCaptcha"  ValidationGroup="LogOnSBP"   
                                                CaptchaTextBoxLabel=""  CssClass="rcAreaCaptcha" EnableRefreshImage="true"   
                                                HttpHandlerUrl="~/SBP.UI.WebResource.axd" Height="24px" Width="128px"   
                                                ImageStorageLocation="Cache" IgnoreCase="False">  
                                               <CaptchaImage ImageCssClass="rcCaptchaImage" TextLength="5" LineNoise="High" BackgroundNoise="High" RenderImageOnly="true"/>  
                                            </telerik:RadCaptcha> 
                                        </td> 
                                        <td style="width:180px; padding-left:10px; text-align:left">  
                                        <div style="float:right"><asp:Label ID="Label1" runat="server"  CssClass="lblCaptcha" AssociatedControlID="rcCaptcha">Digite os caracteres:</asp:Label><asp:TextBox CssClass="tiCaptcha" ID="txtCaptcha" runat="server"></asp:TextBox><asp:RequiredFieldValidator CssClass="erroFail" ID="CaptchaRequired" runat="server" ControlToValidate="txtCaptcha" ErrorMessage="Pass required" ToolTip="Captcha necessário" ValidationGroup="LogOnSBP">*</asp:RequiredFieldValidator></div>  
                                        </td> 
                                    </tr> 
                                  <tr> 
                                        <td colspan="2" style="text-align:center">  
                                            <asp:Button ID="Login" runat="server" CommandName="Login" CssClass="btLogin" Text="Entrar" ValidationGroup="LogOnSBP" /> 
                                            <span style="display:block; color:#D00"><asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></span>  
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                    </table> 
                </LayoutTemplate> 
                <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> 
                <LabelStyle HorizontalAlign="Left" /> 
 
                <FailureTextStyle CssClass="falhaAcesso"></FailureTextStyle> 
            </asp:Login> 
        </telerik:RadAjaxPanel> 
    </div> 
    </form> 

Does anyone imagine what is going on ? Tought about something related to Javascript...


Best regards,

Daniel Bichuete

Pero
Telerik team
 answered on 31 Mar 2010
2 answers
662 views
Hello,

I need to use a for loop instead of a foreach loop to update all the TextBox values(txtQuantity), but I don't know how to reference/cast the GridDataItem to the RadGrid while not being inside of a RadGrid event.
This OnClick works on the most part.  But if evaluates to false it just continues.  I need it to stop.

      protected void btnUpdateCart_Click(object sender, EventArgs e) 
      { 
         // TODO: Use for loop to stop when an expression evaluates to false. 
         //for (int i = 0; i < grdCart.Items.Count; i++) 
         foreach (GridDataItem dataItem in grdCart.MasterTableView.Items) 
         { 
            // TODO: Cast (GridDataItem)dataItem here and remove foreach 
            string strItemId = dataItem.GetDataKeyValue("ID").ToString(); 
            RadTextBox txtQuantity = (RadTextBox)dataItem.FindControl("txtQuantity"); 
            int itemId, quantity; 
            bool success = false
 
            if (Int32.TryParse(strItemId, out itemId) && Int32.TryParse(txtQuantity.Text, out quantity)) 
            { 
               success = _cartItem.Update(itemId, quantity); 
            } 
 
            lblFeedback.Text = success ? "Your cart has been successfully updated!" : "There was an error updating your cart.<br />Please verify that the quantity value is a number and try again."
         } 
 
         grdCart.Rebind(); 
      } 

Thank you in advance,
Ronnie
Ronnie
Top achievements
Rank 1
 answered on 31 Mar 2010
1 answer
85 views
Hello,

Is it possible to have a confirmation message when copy/paste in a MOSS RadEditor?
In the ToolsFile.xml file I added:
...  
    <tool name="FormatStripper">  
      <tool name="StripCss" /> 
      <tool name="StripFont" /> 
      <tool name="StripWord" /> 
    </tool> 
...  
 

In the ConfigFile.xml file I added:
...  
<property name="StripFormattingOptions">MSWord, Css, Font</property> 
.... 

But unfortunatly no message appeared on copy/paste, only security popups appeared (with IE8).

Thanks by advance.

Regards.
Didier.

Rumen
Telerik team
 answered on 31 Mar 2010
9 answers
234 views
Hello,

I am developing an ASP.Net solution that combines RadAjaxManger, RadLayout/Zone/Dock, and RadChart controls.  This question is about using the first two (Ajax and Docks) together.  Here is the setup:

- There is a static RadDockLayout, and three static RadDockZones. 
- Users click and drag from a RadTreeView to add content to the layout.  The drop action causes a RadDock to be added to the targeted RadDockZone.  A WebUserControl is added to the ContentContainer of the RadDock.

This works fine, and user modifications to the layout are persisted to a database.  I am now Ajaxifying the layout, and am having problems.  I'm using a RadAjaxManager.  Since the docks are added dynamically, I'm using the:

            RadAjaxManager1.AjaxSettings.AddAjaxSetting(dock, dock)

command to Ajaxify the docks as they are added to the page, and indicate that they should only update themselves.  Regardless of the AjaxManager settings, however, the docks will almost always update all other docks in the layout.  The exception to this is if I add an AjaxManager dependency to each RadDockZone, indicating that each should only update itself.  In this case, the docks only update the docks in the same zone.  I have also tried adding an ASP:Label control to the page and indicating that the docks should only update that label; this results in the label being updated, along with all the other docks in the layout.

Question: can this be done?  Can I have dynamically-added docks that only update themselves on a Postback?  My plan is to have several reports on the page, and I can't afford to have a dozen reports updating every time a change is made to a single dock. 

Thank you!
Pero
Telerik team
 answered on 31 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?