Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
80 views
Hi there,

I am trying to add a new group of commands to the default RadEditor via the following code (taken from demos):

EditorToolGroup etg = new EditorToolGroup();
rdHTMLEditor.Tools.Add(etg);
EditorTool addLoginLink = new EditorTool();
addLoginLink.Name = "AddLoginLink";
addLoginLink.Text = "Add Login Link";
etg.Tools.Add(addLoginLink);


By doing this, I lose ALL other commands / buttons from the RadEditor, which is not desirable - am I misinterpreting the method .Add() ? I would have thought it would have appended...

If I have to alter the XML to add my commands to, where can I get an up-to-date version of the XML that forms the default RadEditor? Are the files at http://www.telerik.com/support/kb/aspnet-ajax/editor/default-toolsfile-xml-file.aspx still valid?

Update: the files at the link above are not valid, as they are missing some commands (Format code block, etc.)

Thank you,

Mike Kingscott
Mike
Top achievements
Rank 1
 answered on 09 Jan 2012
1 answer
74 views

Hi

We use Telerik Editor as part of the OpenText Context Management System (although I'm not sure what version).

I've noticed that when entering links in the text editor, the order of the HTML attributes is always changed to follow a certain order.

Entering the following test links…

<li><a href="http://www.example.com" title="Example" class="test" rel="external">Example 1</a></li>

<li><a title="Example" rel="external" href="http://www.example.com" class="test">Example 2</a></li>

…always produces:

<li><a class="test" title="Example" rel="external" href="http://www.example.com">Example 1</a></li>

<li><a class="test" title="Example" rel="external" href="http://www.example.com">Example 2</a></li>


Being able to control the order for consistency is great but we would prefer to have href first as it is the most common…having a logical order can help with gzip page size (Google recommends href then alphabetising the rest, e.g., href class rel title). 

Is it possible to override the specified ordering to change to our preference?

Thanks

Neil

Rumen
Telerik team
 answered on 09 Jan 2012
1 answer
120 views
Hell all,

I'm trying to open a RadWindow  with some dynamic behavior inside the RadWindow (grids and forms).  I created a sample project and am able to get the RadWindow open and update controls using Ajax by setting the EnableViewState to false on almost all the controls inside the RadWindow.

Now that I've added a Cancel button, I get the error:

Failed to load viewstate.
The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.
For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request. 

Here is the snippets to the sample project i created for test purposes:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnGetDate" >
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="datePanel" />
            </UpdatedControls>
        </telerik:AjaxSetting>
       <telerik:AjaxSetting AjaxControlID="RadToolBar1" >
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="windowPanel" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadToolBar ID="RadToolBar1" Runat="server"
    onbuttonclick="RadToolBar1_ButtonClick">
    <Items>
        <telerik:RadToolBarButton runat="server" Text="Window">
        </telerik:RadToolBarButton>
    </Items>
</telerik:RadToolBar>
 
<asp:Panel ID="windowPanel" runat="server">
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
 
    <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" >
        <ContentTemplate>
            <asp:Panel ID="datePanel" runat="server">
                Date: <asp:Literal ID="litDate" runat="server" EnableViewState="false"></asp:Literal><br />
             
                <asp:Button ID="btnGetDate" runat="server" Text="Update Date" OnClick="GetDate_Click" EnableViewState="false" />
                <br />
                <asp:Button ID="btnClose" runat="server" Text="Cancel" OnClick="btnClose_Click" EnableViewState="false" />
            </asp:Panel>
        </ContentTemplate>
    </telerik:RadWindow>
</asp:Panel>

The code behind looks like this:

protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
{
    RadWindow1.VisibleOnPageLoad = true;
    RadWindowManager1.Controls.Add(RadWindow1);
    litDate.Text = "not set";
}
 
protected void GetDate_Click(object sender, EventArgs e)
{
    litDate.Text = DateTime.Now.ToLongTimeString();
    RadWindow1.VisibleOnPageLoad = true;
    RadWindowManager1.Controls.Add(RadWindow1);
}
 
protected void btnClose_Click(object sender, EventArgs e)
{
    RadWindow1.VisibleOnPageLoad = false;
    RadWindowManager1.Controls.Remove(RadWindow1);
}

Any help would be appreciated.
Andrey
Telerik team
 answered on 09 Jan 2012
3 answers
172 views
Hi Everyone !

I am creating the email editor with RadEditor. Although I can insert image with Image Manager, when i click the send button the image cannot show. I attach the file . Let me know who can resolve?

Here are my C# code behind.

 SmtpClient smtp = new SmtpClient();
        MailMessage mail = new MailMessage();
        mail.To.Add("xxxxxx@xxxx.com");
        mail.From = new MailAddress("xxxxxx@gmail.com");
        mail.Body = RadEditor1.Content;

        smtp.Host = "smtp.gmail.com";
        smtp.Port = 587;
        smtp.EnableSsl = true;       
        smtp.EnableSsl = true;
        smtp.Send(mail);

Thanks
Htut
Rumen
Telerik team
 answered on 09 Jan 2012
5 answers
138 views
Hello Telerik Community,
     I'm seem to have more problem with the button with telerik sizing issue.  It seem to be ignoring the width property when set.

                    <td ><telerik:RadSpell ID="RadSpell1" runat="server"
                            ControlsToCheck="txtNotes,txtRoute" Visible="False" Width="80px"
                            WordIgnoreOptions="None" />
                    </td>

The total width is about 90px in (IE) (see screen shoots).  
The total width is about 96px in (Firefox) (see screen shoots).

It seem the only way to fix this is to add the width in the <td width=80px>.
Rumen
Telerik team
 answered on 09 Jan 2012
1 answer
101 views
I got struck in strange problem. Actually I previously posted it in the forum and did not get any reply.
In one of my forms I use RadAjaxManager, RadAjaxLoadingPanel, RadTabStrip, RadMultiPage and RadGrid along with some other controls. The page works correctly. My problem is that, when I scroll down the page, it will go up automatically. When I scroll up, it will go down. What would be the problem here?

One more problem is there, the loading panel is not working all the times. Its showing the loading image only some times.
Andrey
Telerik team
 answered on 09 Jan 2012
3 answers
90 views
Hi there everyone, i have the following RadComboBox setup:

<div class="input">
    <telerik:RadComboBox runat="server" ID="radComboBox" AutoPostBack="true"
        Width="394px" EnableEmbeddedBaseStylesheet="False"
        EnableEmbeddedSkins="False" EnableTheming="False"
        ItemsPerRequest="10" MarkFirstMatch="True" ShowMoreResultsBox="True"
        ShowToggleImage="False" EmptyMessage="Search Profiles"
        DropDownCssClass="input-drop" Filter="Contains" DropDownWidth="394px"
        EnableAutomaticLoadOnDemand="True" EnableLoadOnDemand="True" Height="181px"
        OffsetX="-38" OffsetY="8" ShowDropDownOnTextboxClick="False"
        DataTextField="Text" DataValueField="Value" EnableTextSelection="False"
        NoWrap="True">
    </telerik:RadComboBox>
</div>

With the following custom CSS:

.input {
    background-image: url(images/search-input-header.png);
    background-repeat: no-repeat;
    background-position: left top;
    height: 33px;
    width: 374px;
    float: left;
    padding: 10px;
}
.input .rcbInput {
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    line-height: 29px;
    height: 29px;
    width: 374px;
    background-color: #F2FAFF;
    font-family: 'PT Sans', sans-serif, Arial, Helvetica;
    font-size: 24px;
    font-weight: bold;
    color: #1F80BC;
}
.input .rcbEmptyMessage {
    font-family: 'PT Sans', sans-serif, Arial, Helvetica;
    font-size: 24px;
    font-weight: bold;
    color: #d0e9f9;
}
.input .rcbArrowCellHidden {
    display: none;
}
.input-drop {
    height: 106px;
    width: 374px;
    background-image: url(images/search-dropdown-header.png);
    background-repeat: no-repeat;
    background-position: 0px 0px;
    overflow: hidden;
    padding: 10px;
    margin-top: 5px;
    margin-left: 29px;
    z-index: 6001;
}
.input-drop .rcbItem,
.input-drop .rcbHovered
{
    float:left;
    overflow:hidden;
    width:175px;
    font-family: 'PT Sans', sans-serif, Arial, Helvetica;
    font-size: 18px;
    font-weight: normal;
    color: #80CDF2;
    text-decoration: none;
    line-height: 22px;
    height: 22px;
    cursor:pointer;
}
.input-drop .rcbItem em,
.input-drop .rcbHovered em
{
    color: #1F80BC;
    font-style: normal;
    font-weight: bold;
}

Everything works great in all browsers except for IE, specifically IE 9... I am unable to click on any items in the dropdown box, almost as if there is a Zindex issue of some sort.

I have v.2011.3.1115.40 (Trial) installed.

Am i missing something that will make the items clickable in IE??

Any help would be great! Thanks,
Duncan
Duncan
Top achievements
Rank 2
 answered on 09 Jan 2012
3 answers
147 views
Here is a simplified scenario that I would like to achieve.

On a page I have a RadSplitter set to horizontal orientation with two RadPanes. Both panes allow scrolling. In the top-most pane, I have a series of anchor tags that bookmark to various sections to the bottom-most pane. Think of a FAQ site where one can click on the question to then scroll to the answer of that question, and that is the type of functionality that I am trying to achieve.

When one of my links is clicked, the bottom-most pane is scrolled to the section I want, so that is working great. The problem is that the entire page scrolls as well, so that the top-most pane and the link that was clicked are now scrolled off the page. Any idea for a way around this so that the page isn't scrolled at all... just the bottom-pane would be scrolled to the appropriate section?

Thanks,

-Scott
Dobromir
Telerik team
 answered on 09 Jan 2012
10 answers
666 views
I have a grid that binds on !IsPostBack in Page_Load, the grid has a GridClientDeleteColumn column with AutoGenerateColumns="true".  Everything works great until I start binding the grid on ClientSide, then I lose the GridClientDeleteColumn icon and functionality for the grid (only the new row do not have the GridClientDeleteColumn icon), however if I do a post-back on the page then any client side binding after will have the GridClientDeleteColumn.

The reason I am binding at Page_Load is so I get all the column names from my data object.  After the initial first bind (on server side), I am binding from the client side for speed so I don't have to do a full post back after I add/delete/modify my grid data rows.

Code:
ASPX code
-----------------------------------------------------------------------------------------------------------
<script language="javascript">
function AddProduct(productID){
          var myGrid = $find("<%=myGrid.ClientID%>");
          PageMethods.AddProduct(productID, OnSucceeded,OnFailed);
          myGrid.MasterTableView.rebind();        
}

function OnSucceeded(result, userContext, methodName) {
...
}

function OnFailed(error, userContext, methodName) {
...
}

</script>

<telerik:RadGrid ID="myGrid" runat="server" AllowAutomaticUpdates="True"
                                            AllowFilteringByColumn="False" AllowPaging="False" AllowSorting="True"
                                            AutoGenerateColumns="True" EnableEmbeddedSkins="false" EnableViewState="False"
                                            FilterItemStyle-HorizontalAlign="Left" GridLines="None"
                                            GroupHeaderItemStyle-HorizontalAlign="Left"
                                            PageSize="25" ShowFooter="True" EnableClientKeyValues="true"
                                            ShowGroupPanel="false" ShowStatusBar="True" Skin="Sunset">
                                    <clientsettings allowcolumnsreorder="False" allowdragtogroup="False"
                                            reordercolumnsonclient="False">
                                        <clientevents OnRowDeleting="RowDeleting"></clientevents>
                                        <selecting allowrowselect="false" />
                                        <DataBinding Location="MyPage.aspx"
                                            SelectMethod="GetData" SortParameterType="String" EnableCaching="false"
                                            DataPropertyName="Data" CountPropertyName="Count" />
                                    </clientsettings>                           
                                    <mastertableview clientdatakeynames="ProductID"
                                            datakeynames="ProductID" name="MasterTableView">
                                        <columns>                                    
                                            <telerik:GridClientDeleteColumn ConfirmText="Delete this item?" ButtonType="ImageButton"
                                                ImageUrl="delete.gif" CommandName="Delete" Text="Delete">
                                            </telerik:GridClientDeleteColumn>                                                                                    
                                            <telerik:GridBoundColumn UniqueName="ProductID" DataField="ProductID" HeaderText="ProductID">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="ProductName" DataField="ProductName" HeaderText="Product Name">
                                            </telerik:GridBoundColumn>                                            
                                        </columns>
                                    </mastertableview>
 </telerik:RadGrid> 

Add Test Product: <input type="button" id="btnClientButton" onclick="AddProduct(12345)">

<asp:Button id="btnServerButton" OnClick="btnServerButton_Click" runat="server" Text="Do a Post Back Then Everything is A-OK">
-----------------------------------------------------------------------------------------------------------
Server Side Code:
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                        myGrid.DataSource=GetData("")["Data"];
                        myGrid.DataBind();
            }
        }

        [WebMethod(true)]
        public static Dictionary<string,object> GetData(string sortExpression)
       {
                  .
                  .
                  data.add("Data",objDataList);
                  data.add("Count",objDataList.Count);
                  return data;
       }

        [WebMethod(true)]
        public static bool AddProduct(int productID)
        {
                  .
                  .
                  objDataList.Add(productID)        

                  return true;
        }

Why is it that only when there's a post back (at least one post back) then the GridClientDeleteColumn will show when I do a client databind/rebind?



Antonio Stoilkov
Telerik team
 answered on 09 Jan 2012
6 answers
192 views
Hi
I undertand I can set width or max-width of node image using css:

#ExploreTreeView img

{

max-width:16px;

max-height:16px

}


I would like to be able to set the image max width programatically though as it needs to be different for certain nodes.
I noticed there is a style property with RadTadTreeNode, I tried this:

C#
newNode.Style.Value= "img {max-width:22px}";
I really don't know if this syntax is correct, but this doesn't work for me.

Can anyone suggect the right way for me to define the image width/max-width programatically?


Thanks
Richard

 

richard
Top achievements
Rank 1
 answered on 09 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?