Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
149 views
Hi, I'm trying to get a numerictextbox from client. I always get the message "Microsoft JScript runtime error: 'null' is null or not an object"

My JAVASCRIPT
<div id="Div1" runat="server"
<script language="javascript" type="text/javascript"
 
function Itinerario()  
     
     var CUENTAS = $find('<%=TxtNroCtas.ClientID%>');  
     
    if (document.getElementById('RBTipoItinerario_0').checked==true
    { 
        div = document.getElementById('HORARIOS'); 
        div.style.display=''
        CUENTAS.set_visible(false); 
         
    } 
     
    if ( document.getElementById('RBTipoItinerario_1').checked==true
    { 
        div = document.getElementById('HORARIOS'); 
        div.style.display='none'
        CUENTAS.set_visible(true); 
    } 
    
 
 
</script> 
</div> 


My INPUT
<telerik:RadNumericTextBox ID="TxtNroCtas" Runat="server" Skin="Office2007"
   <NumberFormat DecimalDigits="0" GroupSeparator="" /> 
</telerik:RadNumericTextBox> 

Dimo
Telerik team
 answered on 10 Jun 2010
1 answer
208 views
Hi!
I have a RadGrid with a checkbox inside a template column. When I place the grid inside a RadWindow and the checkbox is marked as checked in codebehind it don't become checked when displayed. It works fine when it's not placed inside a RadWindow. Anyone has any suggestions?
Example code below.

/HÃ¥kan

<asp:Button ID="Button1" runat="server" Text="Open" OnClick="Button1_Click" />      
          
<telerik:RadWindow ID="RadWindow1" runat="server">  
    <ContentTemplate> 
        <telerik:RadGrid id="RadGrid1" runat="server">  
            <MasterTableView AutoGenerateColumns="false">  
                <Columns> 
                    <telerik:GridTemplateColumn>                              
                        <ItemTemplate>                                  
                            <asp:CheckBox id="chkSelect" runat="server" /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridBoundColumn DataField="Name" /> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid>         
    </ContentTemplate> 
</telerik:RadWindow> 
protected void Button1_Click(object sender, EventArgs e)  
{  
    List<object> list = new List<object>();  
    list.Add(new { ID = 1, Name = "Item A" });  
    list.Add(new { ID = 2, Name = "Item B" });  
    list.Add(new { ID = 3, Name = "Item C" });  
 
    RadGrid1.DataSource = list;  
 
    RadGrid1.DataBind();  
 
    ((CheckBox)RadGrid1.Items[1].FindControl("chkSelect")).Checked = true//Select Item B  
    RadWindow1.VisibleOnPageLoad = true;  
Svetlina Anati
Telerik team
 answered on 10 Jun 2010
2 answers
1.4K+ views
Hi Telerik,

I'm having trouble with Eval () function in the RadGrid. The function works properly when used like this:

<href="productdetails.aspx?sid=<%#Eval("Stock Number") %>"> 

The reason I am doing all this is because I want to know if the unit displayed has a image for it, if not, then I display  error image (using javascript). In order for me to read the directory i have to know the stock number, and that is why I am using Eval Expression in this fashion:

                                <img id="imgItem1"  alt="" src="<
                        
                                Dim pathUrlFirst as String = "" 
                                Dim stockNumber as String = Eval("Stock Number")
                                Dim ImagePath As String = AppConfig("ImagePath") 
                                Dim pathLocal as String = ImagePath & "pictures\001270\" & stockNumber & "\"   
                                Dim di As New System.IO.DirectoryInfo(pathLocal) 
                                Dim fi As System.IO.FileInfo() = di.GetFiles() '("*.jpg") 
                                Dim fitemp As System.IO.FileInfo 
                                Dim Count As Integer = UBound(fi) + 1 
                                Dim Name As String = "" 
                                 
                                Dim pathURL as String = "pictures/001270/" + stockNumber 
                                 
                                If fitemp.Extension.ToLower = ".jpg" OrElse fitemp.Extension = ".gif" Then 
                                Name = fitemp.Name 
                                pathUrlFirst = pathURL & Name 
                                Response.Write(pathUrlFirst) 
                                End If 
                                 
                                 %>style="width: 120px; border: 1px solid rgb(195, 195, 195);"  /> 

It gives me "System.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control." error.

What should I do in order to use the Eval statement?

The code for entire ItemTemplate is here:
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowMultiRowSelection = "True"   
    AllowSorting="True" DataSourceID="SqlDataSource1" GridLines="None"  
    Width="850px" Height="100%" Skin="Telerik" PageSize="20" > 
<MasterTableView autogeneratecolumns="False" datasourceid="SqlDataSource1"  
        PageSize="50"
    <NoRecordsTemplate> 
       <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True"  
            OnCheckedChanged="ToggleRowSelection" /> 
    </NoRecordsTemplate> 
    <Columns> 
         
         
        <telerik:GridBoundColumn DataField="ID" HeaderText="ID"  
            SortExpression="ID" UniqueName="ID" DataType="System.Int32"  
            ReadOnly="True" Visible="False" AutoPostBackOnFilter="True"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Sys2KNum" HeaderText="Sys2KNum"  
            SortExpression="Sys2KNum" UniqueName="Sys2KNum" Visible="False"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Stock Number" HeaderText="Sort by:"  
            SortExpression="Stock Number" UniqueName="Stock Number"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Year" HeaderText="Year"  
            SortExpression="Year" UniqueName="Year"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Make"  
            HeaderText="Make" SortExpression="Make"  
            UniqueName="Make"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Model" HeaderText="Model"  
            SortExpression="Model" UniqueName="Model"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Veh Type" HeaderText="Veh Type"  
            SortExpression="Veh Type" UniqueName="Veh Type"
        </telerik:GridBoundColumn>         
        <telerik:GridBoundColumn DataField="Body Style" HeaderText="Body Style"  
            SortExpression="Body Style" UniqueName="Body Style"
        </telerik:GridBoundColumn> 
        
    </Columns> 
    <ItemTemplate> 
     
    <div style="height: auto; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px;"
        <table width="95%" border="0" cellspacing="0" cellpadding="0"
            <tr style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px">  
                <td style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                    <div style="font-size: medium; font-weight: bold; text-align: left;">&nbsp;&nbsp;<%#Eval("Year") & " " & Eval("Make") & " " & Eval("Model") & " " & Eval("Unit Trim") & " " & Eval("Fuel Type") & " " & Eval("WheelbaseCode") & " " & Eval("Custom1")%></div
                 
                </td> 
            <tr style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                <td style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                    <table border="0" > 
                        <tr style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                        <td style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                        <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection"  AutoPostBack="True"   runat="server"></asp:CheckBox>  
                        <div runat="server" visible ="false" id="myDiv"><%#Eval("Stock Number") %></div
                        <br /> 
                         
                        </td> 
                            <td  style="border-right-width: 0px; border-bottom-width:0px; border-left-width:    0px"
                             
                       
                            <href="productdetails.aspx?sid=<%#Eval("Stock Number") %>"> 
                             
                                <img id="imgItem1"  alt="" src="<%  
                                
                                Dim pathUrlFirst as String = "" 
                                Dim stockNumber as String = Eval("Stock Number") 
                                Dim ImagePath As String = AppConfig("ImagePath") 
                                Dim pathLocal as String = ImagePath & "pictures\001270\" & stockNumber & "\"   
                                Dim di As New System.IO.DirectoryInfo(pathLocal) 
                                Dim fi As System.IO.FileInfo() = di.GetFiles() '("*.jpg") 
                                Dim fitemp As System.IO.FileInfo 
                                Dim Count As Integer = UBound(fi) + 1 
                                Dim Name As String = "" 
                                 
                                Dim pathURL as String = "pictures/001270/" + stockNumber 
                                 
                                If fitemp.Extension.ToLower = ".jpg" OrElse fitemp.Extension = ".gif" Then 
                                Name = fitemp.Name 
                                pathUrlFirst = pathURL & Name 
                                Response.Write(pathUrlFirst) 
                                End If 
                                 
                              %>style="width: 120px; border: 1px solid rgb(195, 195, 195);"  /> 
                          
                          
                         
                          
                            </a> 
                             
                            </td> 
                            <td  style=" text-align: left;  border-right-width: 0px; border-bottom-width: 0px; border-left-width:   0px"
                            <table  style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                            <!-- 
                            <tr style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                            <td colspan="4" style="border-right-width: 0px; border-bottom-width:0px; border-left-width: 0px" > 
                            <span id="lblDescription" >  
                                <%#IIf(Eval("Sales Description") <> "", Eval("Sales Description").ToString().Substring(0, Math.Min(150, Eval("Sales Description").Length)) & "...&nbsp;&nbsp;<href=""productdetails.aspx?sid=" & Eval("Stock Number") & """>[View More]</a>", "")%> 
                            </span> 
                            </td> 
                            </tr> --> 
                            <tr style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px" > 
                            <td  width="125px" style="border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"
                            Engine:<br /> 
                            Transmission:<br /> 
                            Wheel Drive:<br /> 
                            Stock #:<br /> 
                            </td> 
                            <td  width="100px" style="border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"
                            <%'#Eval("Engine Model")%><br /> 
                            <%'#Eval("Transmission")%><br /> 
                            <%'#Eval("Wheel Base")%><br /> 
                            <%#eval("Stock Number") %><br /> 
                            </td> 
                            <td  width="80px" style="border-right-width: 0px; border-bottom-width:  0px; border-left-width: 0px"
                            Color:<br /> 
                            Package:<br /> 
                            VIN:<br /> 
                            Mileage:<br /> 
                            </td> 
                            <td  width="100px" style="border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"
                             
                            <%#Eval("Ext2 Color")%><br /> 
                            <%#Eval("Unit Trim")%><br /> 
                            <%#Eval("Primary Serial Number")%><br /> 
                            <%#IIf((Eval("Custom2") <> "" Or Eval("Odometer") = "0"), "Please Call", Eval("Odometer"))%><br /> 
                            </td> 
                            </tr>  
                            </table>   
                             
                            <table> 
                            <tr> 
                                <td><%#IIf(Eval("Certified") = 1, "<img src=""images/warranty.jpg""> ", "")%></td
                            </tr> 
                            </table> 
                                                   
                            </td> 
                            <td width="250px" style="border-right-width: 0px; border-bottom-width:  0px; border-left-width: 0px"
                                <table style="border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"
                                    <tr> 
                                        <td width="140px" style="border-right-width: 0px; border-bottom-width:  0px; border-left-width: 0px"
                                            <div align="center"
                                            <div style="font-size: large; font-weight: bold; vertical-align: top"
                                            <%#IIf(Eval("OurPrice") & 0 <> 0, FormatCurrency(Eval("OurPrice"), 2), "In Service")%> 
                                            <br /><br /><br /> 
                                            </div> 
                                            <href="productdetails.aspx?sid=<%#Eval("Stock Number") %>"><img src="images/button/viewdetails.gif" alt="" border="0" style="margin-bottom: 5px" /></a><br /> 
                                            </div> 
                                        </td> 
                                        <td width="110px" style="border-right-width: 0px; border-bottom-width:  0px; border-left-width: 0px"
                                        <div align="center"
                                
                                            <br /><br /> 
                                            <div id="carfax" runat="server" visible="True"
                                                <img src="images/carfax_1owner.png" alt="" border="" /> 
                                            </div> 
                                            <br /> 
                                            </div> 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                    <td colspan="2" style="border-right-width: 0px; border-bottom-width:    0px; border-left-width: 0px"
                                        <div align="center"
                                            <div id="uwm_<%#Eval("Primary Serial Number")%>style="width:150px; height:54px; cursor:hand"></div> 
                                        </div> 
                                    </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                    </table> 
                 </td> 
            </tr> 
             
        </table> 
    </div> 
    </ItemTemplate>               
    <EditFormSettings> 
        <FormTemplate> 
            <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True"  
                OnCheckedChanged="ToggleRowSelection" /> 
        </FormTemplate> 
    </EditFormSettings> 
    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" /> 
</MasterTableView> 
    <ActiveItemStyle BorderStyle="None" /> 
</telerik:RadGrid> 
<asp:SqlDataSource ID="SqlDataSource1" runat="server"  
    ConnectionString="<%$ ConnectionStrings:TestString %>"  
    SelectCommand="SELECT * FROM Vehicles WHERE Sys2KNum = '001270'" > 
</asp:SqlDataSource> 
 


Nikita Yaroshevsky
Top achievements
Rank 1
 answered on 10 Jun 2010
1 answer
92 views
Hello,

I have implemented the RadMenu on a page with a fixed set of 4 menu items. I have followed an example I found where I set the right click and trigger the client side code to show the RadMenu.  This works great -- especially for an Add,Edit,Delete which applies to all rows. 

How do I further customize this to make it row specific. FOr example, for row 1 I might want to show 2 options, versus row 2, 3 options.  depends on the row.  I thought of using the web service, but passing the row is tricky -- or creating a RadMenu per row --- but before I go down either of these paths I wanted to see if I was missing something and there is an easier way.

Thanks,
Todd.
Princy
Top achievements
Rank 2
 answered on 10 Jun 2010
1 answer
102 views
I have a RadPanelGrid that I dynamically add RadPanelItems from the runtime Page Load. On these RadPanelItems are RadGrids which are also dynamically populated from the original page load. Whenever I click on any RadPanelItem which has a grid on it, I want the item to simply expand and display the grid. It is currently doing this, but then firing a postback which calls the page load again. This means that the "dynamic grid adding code" in the Page load happens EVERY time a click happens (rather than just once when the page loaded), otherwise when I click on a RadPanelItem, it expands, posts back, and my grids disappear.

With my current solution, just clicking on an item causes it to expand, postback, and have the grid re-added, when in reality, if there were no postback, this "grid adding code" would not need to be run every time. How do I switch off postbacks for dynamically added rad panel items? I have tried it at runtime, but it doesn't work, and the documentation does support this fact that it should NOT work, so how should I do it then?

I am already harnessing the client side "OnClientItemClicked" event, as I need to do some client side activity when an item is clicked. I do not however want it to post back server side really, as I already have my grids and display complete, and do not need to. I have read some previous threads suggesting that a: 

e.set_cancel(true);


in the client side function is the way to prevent a server side postback, but it doesn't like "set_cancel" as a property of the event args, and is subsequently giving me a: "Object doesn't support this property or method".

The RadPanelBar is on the form at design time, so if there is a property on there that I can set to stop it doing any postbacks then great, otherwise, it will either need to be a property on the runtime added items, or potentially a "slight hack" in the client side script, to prevent the post back after the click. Any solution suits really, but this continual server side post back is having a huge performace hit on the app, so I need to get it ceased. Any help would be greatly appreciated.

  
Nikolay Tsenkov
Telerik team
 answered on 10 Jun 2010
2 answers
159 views

Hi Telerik,

I have seen the Documentation for RadGrid usercontrol but sometimes it uses the RadGrid control from the Telerik.WebControls namespace. I am using the RadGrid control from the Telerik.Web.UI namespace.  Could you provide me any posts or links on how to perform add, modify and delete operations on the data in the RadGrid.

Thanks



Akhilaa
Top achievements
Rank 1
 answered on 10 Jun 2010
8 answers
289 views
Hello -
Trying to use the TimelineView -

First Question: How do I set the width of the Grouping column?  (Screenshot #1, the column that says "TP Room" is too small).

Second Question:
I would like the Timeline to show only the availability hours between 7 AM to 23 PM.
I've set DayStartTime="07:00:00" DayEndTime="23:00:00" and also WorkDayStartTime="07:00:00" WorkDayEndTime="23:00:00".
But still when I navigate back 1 day, it will show the hours just before 7 AM (see Screeshot #2).

Also when I use the Date Picker to select a random date, it will display from 00 AM, and not from 7 AM to 23 PM as specified...

Here is my ASP code:
        <telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="TimelineView" ColumnWidth="60px" 
            SelectedDate="2010-03-24 07:00:00" DayStartTime="07:00:00" DayEndTime="23:00:00" 
            DataSourceID="MeetingsDataSource" DataKeyField="MeetingID" DataStartField="StartDate" 
            DataEndField="EndDate" DataDescriptionField="Subject" DataSubjectField="Subject"
            <TimelineView SlotDuration="01:00:00" NumberOfSlots="16" GroupBy="Room" GroupingDirection="Vertical" 
                ShowDateHeaders="true" ColumnHeaderDateFormat=" H" /> 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="RoomsDataSource" ForeignKeyField="RoomID" 
                    KeyField="RoomID" Name="Room" TextField="RoomName" /> 
            </ResourceTypes> 
        </telerik:RadScheduler> 

cheers!
 -bash
T. Tsonev
Telerik team
 answered on 10 Jun 2010
1 answer
155 views
Hi

I'm using the filter template and have a radComboBox with a select to display a list of options. What I'm doing id populating the gid with a call to a database, then populating the combobox with another call to the database.

Is it possible to populate the combobox from the already downloaded grid data, this would serve 2 purposes, 1 - one less database call and 2 - the combo box would only have that data which exists in the grid whtout a complcated where clause.

Andy
Shinu
Top achievements
Rank 2
 answered on 10 Jun 2010
5 answers
111 views
Hi to all!

I have my principal page that have a control with a toolbar and radAjaxPanel.
The toolbar have the icon for save, adding, modify, delete, foword, back. My question is how i send the event of the click in the button save to the control loaded in the radAjaxPanel?

Maria Ilieva
Telerik team
 answered on 10 Jun 2010
1 answer
222 views
Hi,

I have a RadTreeView with dynamic items, dynamically added on server-side. The RadTreeView has 2 ContextMenues declared in HTML, on server-side I set the ContextMenueID-Property depending on an attribute from the database (simplified in the example)

If I run the site, I get a Javascript error "menu is null" on line "var items = menu.get_items();"

This used to work before, but I don't know version I used back then.
Now I'm using newest release 2010.1.519(.40)

Here's the aspx-Content:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="Intranet.test" %> 
<%@ 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 id="Head1" runat="server"
    <title>Intranet</title> 
</head> 
 
<body style=" background-color:White;"
    <form id="form1" method="post" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server"
    </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        </telerik:RadAjaxManager> 
 
        <div class="divMenue">  
            <telerik:RadAjaxPanel ID="rap_Menue" runat="server" ClientIDMode="Static"
                <telerik:RadTreeView ID="rtv_Menue" ClientIDMode="Static" Runat="server" DataNavigateUrlField="URL" 
                    DataTextField="Title" EnableViewState="true" 
                    AfterClientToggle="AfterClientToggle" EnableDragAndDrop="True"                          
                    EnableDragAndDropBetweenNodes="True" LoadingMessage="Wird geladen ..." OnClientContextMenuShowing="ClientContextMenuShowing"               
                    Skin="Default" OnClientLoad="setTree" > 
                    <ContextMenus> 
                        <telerik:RadTreeViewContextMenu ID="ctm_FavMenu" runat="server"  
                Skin="Default">                         
                            <Items> 
                                <telerik:RadMenuItem runat="server" Text="New"
                                    <Items> 
                                        <telerik:RadMenuItem> 
                                            <ItemTemplate> 
                                                <table> 
                                                    <tr> 
                                                        <td>Name:</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavName" Width="300px" /></td
                                                    </tr> 
                                                    <tr> 
                                                        <td>URL</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavURL" Width="300px" /></td
                                                    </tr>                 
                                                    <tr> 
                                                        <td>Icon</td> 
                                                        <td> 
                                                            <asp:RadioButtonList runat="server" RepeatColumns="8" ID="rbl_FavIcon" /> 
                                                        </td> 
                                                    </tr>                                                 
                                                </table>                 
                                            </ItemTemplate> 
                                        </telerik:RadMenuItem> 
                                        <telerik:RadMenuItem runat="server" IsSeparator="true"/> 
                                        <telerik:RadMenuItem runat="server" Text="Speichern"/> 
                                    </Items> 
                                </telerik:RadMenuItem> 
                                <telerik:RadMenuItem runat="server" Text="Edit"
                                    <Items> 
                                        <telerik:RadMenuItem> 
                                            <ItemTemplate> 
                                                <table> 
                                                    <tr> 
                                                        <td>Name:</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavNamechng" Width="300px" /></td
                                                    </tr> 
                                                    <tr> 
                                                        <td>URL</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavURLchng" Width="300px" /></td
                                                    </tr>                 
                                                    <tr> 
                                                        <td>Icon</td> 
                                                        <td> 
                                                            <asp:RadioButtonList runat="server" RepeatColumns="8" ID="rbl_FavIconchng" /> 
                                                        </td> 
                                                    </tr>                                                 
                                                </table>                 
                                            </ItemTemplate> 
                                        </telerik:RadMenuItem> 
                                        <telerik:RadMenuItem runat="server" IsSeparator="true"/> 
                                        <telerik:RadMenuItem runat="server" Text="Speichern"/> 
                                    </Items> 
                                </telerik:RadMenuItem> 
                                <telerik:RadMenuItem runat="server" Text="Löschen" /> 
                            </Items> 
                        </telerik:RadTreeViewContextMenu> 
                        <telerik:RadTreeViewContextMenu ID="ctm_NormMenu" runat="server" Skin="Default">                         
                            <Items> 
                                <telerik:radmenuitem runat="server" Text="Add to Favorits" /> 
                            </Items> 
                        </telerik:RadTreeViewContextMenu> 
                    </ContextMenus> 
                </telerik:RadTreeView>     
            </telerik:RadAjaxPanel>               
        </div>  
 
    <telerik:RadScriptBlock ID="rsb_getTree" runat="server"
        <script type="text/javascript" language="javascript"
            var tree; 
            window.onbeforeunload = onRequestStart
 
            function setTree(sender, eventArgs) { 
                tree = $find('<%=rtv_Menue.ClientID%>'); 
            } 
 
            function createCookie() { 
                var toggleActions = ""
                var nodes; 
                var node; 
 
                nodes = tree.get_allNodes(); 
 
                for (var i = 1; i < nodes.length; i++) { 
                    node = nodes[i] 
                    if (node.get_expanded()) { 
                        toggleActions += node.get_value() + '*'; 
                    } 
                } 
                var date = new Date(); 
                date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000)); 
                var expires = "; expires=" + date.toGMTString(); 
 
                document.cookie = "TreeToggleActions=" + toggleActions + expires + "; path=/"; 
            } 
 
            function onRequestStart(sender, arguments) { 
                createCookie(); 
            } 
 
            function onResponseEnd(sender, arguments) { 
                isUpdatingAppointment = false
            } 
 
            function ClientContextMenuShowing(sender, eventArgs) { 
                var node = eventArgs.get_node(); 
                var menu = eventArgs.get_menu();
                var items = menu.get_items(); //Error is thrown here, "menu is null"
 
                document.getElementById('txt_FavNamechng').value = node.get_text(); 
                document.getElementById('txt_FavURLchng').value = node.get_navigateUrl(); 
 
            } 
 
        </script> 
    </telerik:RadScriptBlock> 
 
    </form> 
</body> 
</html> 
 


And the CodeBehind:
Imports Telerik.Web.UI 
 
Public Class test 
    Inherits System.Web.UI.Page 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
        Dim node = New RadTreeNode() 
        node.Text = "TestNode" 
        node.ContextMenuID = "ctm_FavMenu" ''same with ctm_NormMenu 
        rtv_Menue.Nodes.Add(node) 
    End Sub 
 
End Class 



Any help is appreciated,

Lukas
Nikolay Tsenkov
Telerik team
 answered on 10 Jun 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?