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

I have a problem trying to get the contents of a RadEditor located inside a User control through AJAX. The main page has a Radstrip with a multipage and each pageview has attached an instance of the User control with the editor and a button.

When the User control is created from code behind, some default contents are set from the main page to the Editor and it's working properly. But, if we change that text and we call a postback with AJAX, I cannot get the new value.

I am not sure how to proceed to get new values...

thanks.

The User Control:
<telerik:RadEditor ID="RadEditor1" runat="server" Width="100%" BorderStyle="None" EditModes="Design" ContentAreaCssFile="~/css/EditorContentArea.css" ContentAreaMode="iframe">
    <CssFiles>
        <telerik:EditorCssFile Value="~/css/EditorContentArea.css" />
    </CssFiles>
    <Tools>
        <telerik:EditorToolGroup Tag="MainToolbar">
            <telerik:EditorTool Name="AjaxSpellCheck" />
            <telerik:EditorTool Name="FindAndReplace" />
            <telerik:EditorSeparator />
            <telerik:EditorSplitButton Name="Undo">
            </telerik:EditorSplitButton>
            <telerik:EditorSplitButton Name="Redo">
            </telerik:EditorSplitButton>
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup Tag="Formatting">
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool Name="Italic" />
            <telerik:EditorTool Name="Underline" />
            <telerik:EditorSeparator />
            <telerik:EditorSplitButton Name="ForeColor">
            </telerik:EditorSplitButton>
            <telerik:EditorSplitButton Name="BackColor">
            </telerik:EditorSplitButton>
            <telerik:EditorSeparator />
            <telerik:EditorDropDown Name="FontName">
            </telerik:EditorDropDown>
            <telerik:EditorDropDown Name="RealFontSize">
            </telerik:EditorDropDown>
        </telerik:EditorToolGroup>
    </Tools>
    <Content>
</Content>
</telerik:RadEditor>
<div style="float:left;">
<telerik:RadSpell ID="RadSpell1" runat="server" ControlToCheck="RadEditor1" ButtonType="PushButton" AllowAddCustom="true" CssClass="floatL" />  
<telerik:RadButton ID="RadButton1" runat="server" Text="Save" Height="22px" />
</div>

User Control Code behind:
Imports Telerik.Web.UI
 
Public Delegate Sub RadButton1_Click(sender As Object, e As System.EventArgs)
 
Public Class productAttributesEditor
    Inherits System.Web.UI.UserControl
    Public Event SaveClick As RadButton1_Click
 
    Public singleLang As String
 
    Public Property RadEditor() As RadEditor
        Get
            Return RadEditor1
        End Get
        Set(value As RadEditor)
            RadEditor1 = value
        End Set
    End Property
 
    Public Property SpellSingleLanguage() As String
        Get
            Return singleLang
        End Get
 
        Set(value As String)
            singleLang = value
        End Set
    End Property
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            RadEditor1.Modules.Clear()
            RadEditor1.Languages.Clear()
            RadEditor1.SpellCheckSettings.AllowAddCustom = True
            RadEditor1.SpellCheckSettings.SpellCheckProvider = SpellCheckProvider.PhoneticProvider
 
            If String.IsNullOrEmpty(singleLang) Then
                Using ctx As New MyLovelyFood_DynamicStocksEntities()
                    Dim langs = From a In ctx.aux_languageList Where a.Published = True And a.SpellEnabled = True Select a.LanguageCulture, a.Name, a.PrimaryLang Order By PrimaryLang
                    For Each row In langs
                        RadEditor1.Languages.Add(New SpellCheckerLanguage(row.LanguageCulture, row.Name))
                    Next
                End Using
            Else
                RadEditor1.SpellCheckSettings.DictionaryLanguage = singleLang
            End If
        End If
    End Sub
 
    Protected Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
        RaiseEvent SaveClick(Me, e)
    End Sub
End Class

Default page:
    ' Prepare text editor
' For each Tab, create a new Editor...
    Private Sub RadTabStripIngredients_TabDataBound(sender As Object, e As RadTabStripEventArgs) Handles RadTabStripIngredients.TabDataBound
        Dim pageView As New RadPageView()
        pageView.ID = e.Tab.Value
        RadMultiPageIngredients.PageViews.Add(pageView)
    End Sub
 
    Private Sub RadMultiPageIngredients_PageViewCreated(sender As Object, e As RadMultiPageEventArgs) Handles RadMultiPageIngredients.PageViewCreated
        editorControl = LoadControl("~/common/AttributesEditor.ascx")
        editorControl.ID = e.PageView.ID & "_userControl"
 
        Using ctx As New DynamicStocksEntities()
            Dim langCulture = From a In ctx.aux_languageList Where a.Id = e.PageView.ID Select a.LanguageCulture
            editorControl.SpellSingleLanguage = langCulture.FirstOrDefault
        End Using
 
        e.PageView.Controls.Add(editorControl)
        AddHandler editorControl.SaveClick, AddressOf SaveEditor
    End Sub
 
    Private Sub SaveEditor(ByVal sender As Object, ByVal e As EventArgs)
        Dim editorObj As productAttributesEditor = TryCast(sender, Object)
        Dim content As String = TryCast(editorObj.RadEditor, RadEditor).Text
        MsgBox(content) ' >>>> ERROR, WE JUST RECEIVE THE INITIAL VALUE INSTEAD OF THE MODIFIED VERSION
        If Not String.IsNullOrEmpty(Trim(content)) Then
' DO SOMETHING
        End If
    End Sub
Rumen
Telerik team
 answered on 10 May 2013
8 answers
149 views
Dear Telerik,

We've been happily using your RadAjax controls from the 2011.2.712.35 build for the past 2 years, but this week it was time to upgrade the build version, mainly in our hope to deal with IE10 woes.  We're now running the 2013.1.403.35 build on our SharePoint components. The upgrade mainly went smooth, minus the calendar component.  None of the Ajax functionality is working.  I've setup a simple page to demonstrate the failure.  Is there anything that I need to make sure is present in my code?  Maybe you can suggest a place to start looking?... I'm running out of ideas.  Any help is appreciated!

broken calendar: http://2010test.corasworks.net/df/public/SitePages/calendar.aspx
working grid: http://2010test.corasworks.net/df/public/SitePages/grid.aspx
working tree view: http://2010test.corasworks.net/df/public/SitePages/tree%20view.aspx

Thank you,

Dasha.
Plamen
Telerik team
 answered on 10 May 2013
9 answers
1.2K+ views
Hi,
I would like to use row selection but don't want the row to be highlighted in any way - just use the GridClientSelectColumn checkbox to show the selection. How can I turn the highlighting off?
Clayton

Shinu
Top achievements
Rank 2
 answered on 10 May 2013
1 answer
244 views
for v2013.1.220.40

While using the RadEditor in Chrome, a zero width space (&#8203;) is inserted under some circumstances. For example, starting with a blank editor, if you click into the editor, change the font size, click back into the editor and type "test", a zwsp is inserted between the end of the font tag and "test". The problem is when the content is saved to the database, it is saved as a question mark, which is far from ideal. I do not experience this behavior in IE. 

Is there a way to prevent the insertion of the zwsp character?
Niko
Telerik team
 answered on 10 May 2013
3 answers
241 views
What I have is a linkbutton with a command name on myradgrid to call my radwindow.  So what I need to do is populate the checkbox list that sits in myradwindow on the click of this linkbutton, to populate the checkbox list and see if anything exists check the boxes if not check nothing.

Right now just trying to figure how I can get the checkboxes to populate.  After this I will need to pass a value to either populate the list with checkboxes or not depending if saved in DB.

<telerik:RadWindow ID="RadTeams" runat="server" Width="500px" Height="250px" Enabled="true" Modal="true" VisibleTitlebar="false" VisibleStatusbar="false" CssClass="CentTable">
           <ContentTemplate>
               <table class="CentTable">
                   <tr>
                       <td style="text-align:center">Please Pick Teams to Assign to Region</td>
                   </tr>
                   <tr>
                       <td style="height:5px" ></td>
                   </tr>
                   <tr>
                       <td>
                           <asp:CheckBoxList ID="cbTeams" runat="server" AutoPostBack="false" RepeatDirection="Horizontal" RepeatColumns="3" TextAlign="Right"></asp:CheckBoxList>
                       </td>
                   </tr>
                   <tr>
                       <td style="text-align:center">
                           <asp:LinkButton ID="lnkSubmit" runat="server" Text="Submit"></asp:LinkButton>
                                
                           <asp:LinkButton ID="lnkCancel" runat="server" Text="Cancel"></asp:LinkButton>
                       </td>
                   </tr>
               </table>
           </ContentTemplate>
       </telerik:RadWindow>



<telerik:GridTemplateColumn>
          <ItemTemplate>
                      <asp:LinkButton ID="lnkAssign" runat="server" CommandArgument='<%# Bind("strRegionCode")%>' Text="Assign Teams" CommandName="Assign" OnClientClick='<%# String.Format("addAdminWin({0}, {1}); return false;", Eval("intRegionID"), 2)%>'></asp:LinkButton>
              </ItemTemplate>
</telerik:GridTemplateColumn>
Marin Bratanov
Telerik team
 answered on 10 May 2013
1 answer
344 views
Hi
     I want to clear the content of RadTextBox when the user focuses on a textbox so that the user can write his/her name.
thanks
Savyo
Shinu
Top achievements
Rank 2
 answered on 10 May 2013
1 answer
117 views
I have an enquiry form that I want to place in a popup window accessed from a link on my main page.  If a user has popups disabled this should stop the window from opening.  How can I detect if the window cant be opened and divert the user to a different page ?
Marin Bratanov
Telerik team
 answered on 10 May 2013
1 answer
473 views
Dear All,

I have page1.aspx that has many IFrame and linked one aspx(page2.aspx, page3.aspx amd so on). Each fram has one rad grid in it with navigate URl. onclicking that url it should open modal popu(Rad windows) outside the iframe and on page1.aspx

I have added this in page1.aspx and access this in page2.aspx to open Modal Windows outside the IFrame. I saw example in internet that has nvigate URL in telerik:RadWindow  Tag in Design time. but for me I am passing Qurystring to the URL which is available at run time.
I can give URL with Query string during Run Time based on the row clicked in the grid.


<telerik:RadWindowManager ID="ParentRadWindowManager1" runat="server" EnableShadow="true"
                        Style="z-index: 7000">
                        <Windows>
                            <telerik:RadWindow ID="ParentUserListDialog" runat="server" Title="View record" ReloadOnShow="true"
                                ShowContentDuringLoad="false" Modal="true" BorderStyle="None" NavigateUrl="~/web/Transaction/OPMS_UI_Goals.aspx?KeyValue='2' &GoalId='201301002' &Source='DBrd'">
                            </telerik:RadWindow>
                        </Windows>
                    </telerik:RadWindowManager>

In each Iframe Page. This function is added as given below.
I want to give Navigate URL with Query string here. Kindly guide me on this.

<script type="text/javascript">
    function openWin() {
        var oManager = window.parent.GetRadWindowManager();
        //Show a particular existing window
        oManager.open(null, "ParentUserListDialog");
    }
</script>


Thanks and Regards
L.Palanivelrajan
Marin Bratanov
Telerik team
 answered on 10 May 2013
1 answer
61 views
Is there a way to start the editor in Html view and not Design view?
Rumen
Telerik team
 answered on 10 May 2013
3 answers
78 views
Hi,
We have a requirement to upload more than 50K images at once. The current functionality of RadAsyncUpload supports uploading around 3000 pictures at once. I tried to upload 8000 pictures in your online demo page, but the page got stuck for several minutes and after the page started responding, it didn't even start uploading. All the characters on the page were distorted as well. Do you suggest anything that can help us meet the requirement?

Thanks,
Sriram.
Ivan Zhekov
Telerik team
 answered on 10 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?