Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
154 views
I have a problem when i following sample TreeView in ComboBox, I do a bit modify. I load node from XML file(same thing happen binf with datatable).

when select a node from treeview, the combobox item showing all Text values in the treeview at first time.  But it's fine if i select again.

For example:
Page init: blank
select node "Books": shows "booksArtsBiographies..." (suppose showing "Books")
select node "Music":  shows "Music"



please try following sample:
Aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="Default9" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <script type="text/javascript">          
        function nodeClicking(sender, args)  
        {  
            var comboBox = $find("<%=RadComboBox1.ClientID%>");  
            var node = args.get_node()  
 
            comboBox.set_text(node.get_text());  
            comboBox.set_value(node.get_value());  
              
            comboBox.hideDropDown();  
        }          
</script> 
    <div> 
      
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        </telerik:RadAjaxManager> 
      
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
        </telerik:RadScriptManager> 
      
        <telerik:RadComboBox ID="RadComboBox1" ShowToggleImage="True" OnItemsRequested="ItemsRequested" Runat="server">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            <ItemTemplate> 
                <telerik:RadTreeView ID="RadTreeView1"   
                                OnClientNodeClicking="nodeClicking" Runat="server">  
                </telerik:RadTreeView> 
            </ItemTemplate> 
            <Items> 
                <telerik:RadComboBoxItem Selected="True"></telerik:RadComboBoxItem> 
            </Items> 
        </telerik:RadComboBox> 
      
    </div> 
    </form> 
</body> 
</html> 
 

Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
using System.Xml.Linq;  
 
public partial class Default9 : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack && !RadAjaxManager1.IsAjaxRequest)  
        {  
            Populate();  
        }  
    }  
 
    private void Populate()  
    {  
        if (RadComboBox1.Items.Count == 0)  
        {  
            RadComboBox1.Items.Add(new RadComboBoxItem());  
        }  
 
        RadTreeView ParenTreeView = (RadTreeView)RadComboBox1.Items[0].FindControl("RadTreeView1");  
 
        ParenTreeView.LoadContentFile("TreeView.xml");  
    }  
 
 
 
    protected void ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)  
    {  
        Populate();  
    }  
}  
 

XML:
<?xml version="1.0" encoding="utf-8" ?> 
<Tree> 
  <Node Text="Books" Expanded="True">  
    <Node Text="Arts" /> 
    <Node Text="Biographies" /> 
    <Node Text="Children's Books" /> 
    <Node Text="Computers &amp;amp; Internet" /> 
    <Node Text="Cooking" /> 
    <Node Text="History" /> 
    <Node Text="Fiction" /> 
    <Node Text="Mystery" /> 
    <Node Text="Nonfiction" /> 
    <Node Text="Romance" /> 
    <Node Text="Science Fiction " /> 
    <Node Text="Travel" /> 
  </Node> 
  <Node Text="Music">  
    <Node Text="Alternative" /> 
    <Node Text="Blues" /> 
    <Node Text="Children's Music" /> 
    <Node Text="Classical" /> 
    <Node Text="Country" /> 
    <Node Text="Dance" /> 
    <Node Text="Folk " /> 
    <Node Text="Hard Rock" /> 
    <Node Text="Jazz" /> 
    <Node Text="R&amp;amp;B" /> 
    <Node Text="Soundtracks" /> 
  </Node> 
  <Node Text="Movies">  
    <Node Text="Action" /> 
    <Node Text="Animation" /> 
    <Node Text="Classics" /> 
    <Node Text="Comedy" /> 
    <Node Text="Documentary" /> 
    <Node Text="Drama" /> 
    <Node Text="Horror" /> 
    <Node Text="Musicals" /> 
    <Node Text="Mystery" /> 
    <Node Text="Westerns" /> 
  </Node> 
  <Node Text="Software">  
    <Node Text="Business &amp;amp; Office" /> 
    <Node Text="Database" /> 
    <Node Text="Networking" /> 
    <Node Text="Presentation" /> 
    <Node Text="Project Management" /> 
    <Node Text="Reports" /> 
    <Node Text="Spreadsheet" /> 
    <Node Text="Word Processing" /> 
  </Node> 
</Tree> 
Rosi
Telerik team
 answered on 30 Sep 2008
2 answers
265 views

Hi

I am writing a web user control (ascx) that includes a RadEditor.  This control is being added to a page on one of our Sharepoint sites. 

I have got the control and the editor working, but I am not sure where to place the image files that we have created to be displayed on the custom buttons I hve added to the editor's toolbar.

The directory structure on the Sharepoint Web Front end is currently set up like this:

Inetpub
...wwwroot
......wss
.........VirtualDirectories
............80
...............App_Data
..................RadSpell (contains the editor dictionary files)
...............App_GlobalResources (contains the editor resx files)
...............EditorSetupFiles (this is where I have added our toolsfile.xml and the custom icon .gif files)

The .ascx file is stored in Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES\myCustomControls on the same web front end server.  It contains the following code:

<%@ Control Language="vb" ClassName="RadTest" %>
' include files here
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI"
Assembly="Telerik.Web.UI, Version=2008.2.723.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>

<style type="text/css">
.rade_toolbar.Default .InsertAbbr
{
   background-image: url(~/EditorSetupFilesT/icon_abbreviation.gif);
}
.rade_toolbar.Default .InsertBlockQuote
{
   background-image: url(~/EditorSetupFiles/icon_blockquote.gif);
}
.rade_toolbar.Default .InsertQuote
{
  background-image: url(~/EditorSetupFiles/icon_quote.gif);
}
</style>

<script runat="server">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        litEditCharges.Text = "You can edit charges here..."
 myEditor.content = "center centre some text here"
    End Sub

</script>
 
<asp:ScriptManager runat="server" ID="ScriptManager1" />
<asp:Literal runat="server" ID="litEditCharges"></asp:Literal>
<telerik:RadEditor Runat="server" id="myEditor" ToolsFile="~/EditorSetupFiles/ToolsFile.xml" Language="en-GB" EditModes="Design, Html" SpellCheckSettings-DictionaryLanguage="en-gb" >
   <Tools>
       <telerik:EditorToolGroup >
           <telerik:EditorTool Name="InsertAbbr" Text="Insert Abbreviation" />
           <telerik:EditorTool Name="InsertBlockQuote" Text="Insert Block Quote" />
           <telerik:EditorTool Name="InsertQuote" Text="Insert Quote" />
       </telerik:EditorToolGroup>
   </Tools>             
</telerik:RadEditor>

    <script type="text/javascript">
    //<![CDATA[
    Telerik.Web.UI.Editor.CommandList["InsertAbbr"] = function(commandName, editor, args)
    {
   //javascript code for function
   }
    };
   
    Telerik.Web.UI.Editor.CommandList["InsertBlockQuote"] = 
     function CustomDialogCommand(commandName, editor, oTool) 
         { 
    //javascript code for function
            };

    Telerik.Web.UI.Editor.CommandList["InsertQuote"] = 
     function CustomDialogCommand(commandName, editor, oTool) 
         { 
   //javascript code for function
            };

    //]]>
    </script>

Using this the icons show up completely blank.  If I change the name of the skin in the css declaration the button has a (!) icon, so I think the problem is that the icon files are in a directory that cannot be read. 

Thanks for any help
Peter

Peter Livsey
Top achievements
Rank 1
 answered on 30 Sep 2008
1 answer
123 views
HI

How to set default Font Name in Editor to Tahoma ?

Regards,
Vinodh
Rumen
Telerik team
 answered on 30 Sep 2008
8 answers
497 views
I'm using VS2008 (preference is vb.net) and had loaded the RadControls for Ajax last week.  I started a web project using Framework 3.5. While in the Toolbox none of the RadControls show up.  When I right click and choose SHOW ALL, the RadControls show up BUT they are all disabled,
non-selectable.  All of them are that way.  I also opened up the RadControlsSamples solution into VS2008.  It loaded OK, after going thru the conversion process, but the controls in the Toolbox are still disabled, grayed out.  Thought it might be my VS2008, so I went thru the repair process for VS2008, but still the same results, the controls are grayed out.  I can't use them.  What can I do???  

Ted
Niklas Boström
Top achievements
Rank 2
 answered on 30 Sep 2008
1 answer
192 views
I recently converted a radgrid being bound through asp.net server side to client side via json and web service.  The grid has an anchor tag in one of the cells, which I created previously using the gridtemplatecolumn.  How do I do the same thing with json binding?  I've tried encoding an anchor tag in the json object with no success.

Thanks,
Andy

Vlad
Telerik team
 answered on 30 Sep 2008
1 answer
115 views
Hi,

I  am using Telerik 2008.02.0826.35 version. In rad editor i am having problem in retaining absolute link path, i enabled MakeUrlsAbsolute in ContentFilter.

Here is the problem i am facing, when inserted image in the design mode and if i check the image properties it shows like "/upload/images/test.jpg" If i click on html mode the same link will show as http://domainname/upload/images/test.jpg that's what i am looking for,
i want the absolute link to be show in design mode.

Does content filter work in Html mode only ?


Thanks in advance
Rumen
Telerik team
 answered on 30 Sep 2008
1 answer
106 views
We are migrating our application to ASP.NET Ajax controls 2008.2.826.20.

I have a page with a RadDockLayout inside of a RadAjaxPanel.  The controls are added to zones via a ContentTemplate during Page_Load (I tried Page_Init but it didn't make a difference).  Inside the template is an asp.net GridView.

The page loads fine.  However, when I click to scroll to the next page of the gridview, that event is never fired.

I read the documentation about adding dynamic controls, but our zones are fixed and not draggable, so saving the state didn't seem necessary.

What am I missing?

Thanks,

Leslie
Petio Petkov
Telerik team
 answered on 30 Sep 2008
1 answer
102 views
Hello,

I am using a Grid, with EditMode="PopUp" do update my record

I have added a RadDatePicker to handle a DateTime field, but when i click the "edit" link in the grid, and the edit popupwindow is shown, a javascript error is fired (i guess in english the error is "missing object" or something like that)

The calendarpopup is not shown when i click the calendar button

There is something in particular to set for a datepicker in a popupwindow?

Thanks

Francesco
Iana Tsolova
Telerik team
 answered on 30 Sep 2008
1 answer
130 views
I've managed to get data between the RadGrid and the UserControl during databinding (i.e. as the control is being displayed, before the user enters any data) but I am not able to get any data back from the UserControl once the PerformInsert command is called. Upon examining the contents of e.Item, there are only 2 controls in the container both with type "Telerik.Web.UI.GridEditFormItem+EditFormTableCell". I'm using the following code to attempt to access the UserControl:

    Sub ChannelsList_InsertCommand(ByVal sender As ObjectByVal e As GridCommandEventArgs) Handles ChannelsList.InsertCommand 
        If Not e.Canceled Then 
            Dim editedRow As GridEditableItem = CType(e.Item, GridEditableItem) 
            Dim channelEditor As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl) 
            Dim channelsFile As ChnFile = CType(Session("ChannelsFile"), ChnFile) 
            Dim channel As New Channel() 
 
            With channel 
                .Name = CType(editedRow.FindControl("tbxDisplayName"), RadTextBox).Text 
                .Phonetic = CType(editedRow.FindControl("tbxPhonetic"), RadTextBox).Text 
                .Comment = CType(editedRow.FindControl("tbxComment"), RadTextBox).Text 
            End With 
        End If 
    End Sub 


I've modeled the approach after the examples provided in the live demos and the documentation but nothing seems to be working. Any help would be greatly appreciated!

Thanks, Jason
Jason
Top achievements
Rank 2
 answered on 30 Sep 2008
1 answer
124 views
Hi,

Can I configure a RadDock that's not possible to drag the RadDock outside of a RadDockZone? It should only be possible to "sort" the RadDock in the given RadDockZone.

Thomas
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 30 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?