Remove the imagebackground-image:none !important;Replace the imagebackground-image:"~\Image\img.png" !important;<telerik:RadToolBar ID="RadToolBar1" runat="server"> <Items> <telerik:RadToolBarButton runat="server" Text="Button 1" DisplayName="TextBox1"> <ItemTemplate> <input type="text" value='<%# DataBinder.Eval(Container, "Attributes['DisplayName']") %>' /> </ItemTemplate> </telerik:RadToolBarButton> <telerik:RadToolBarDropDown runat="server" Text="DropDown 1" DisplayName="DropDown"> <Buttons> <telerik:RadToolBarButton runat="server" Text="Child Button 1" DisplayName="TextBox11"> <ItemTemplate> <input type="checkbox" value='<%# DataBinder.Eval(Container, "Attributes['DisplayName']") %>' /> </ItemTemplate> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Child Button 2" DisplayName="TextBox21"> <ItemTemplate> <input type="text" value='<%# DataBinder.Eval(Container, "Attributes['DisplayName']") %>' /> </ItemTemplate> </telerik:RadToolBarButton> </Buttons> </telerik:RadToolBarDropDown> <telerik:RadToolBarSplitButton runat="server" Text="SplitButton 1" DisplayName="SplitButton"> <Buttons> <telerik:RadToolBarButton runat="server" Text="Child Button 1"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Child Button 2"> </telerik:RadToolBarButton> </Buttons> </telerik:RadToolBarSplitButton> </Items> </telerik:RadToolBar>Hi, i'm using a RadTreeView with a RadTreeViewContextMenu.
At my page load i'm building the contextmenu with my options.
Each RadMenuItem is defined with de code below.
RadMenuItem item=new RadMenuItem('Description','../GestaoEntidade.aspx?mode=ins&type='+xxx);
item.Target = "paneMain";
After my menu is finish, i'm adding it to the tree context menu collection.
Then when i'm building the tree i assing too all my nodes the context menu ID;
node.ContextMenuID = contexMenu.ID;
With this i'm trying to achive the following:
open the contextmenu of a node, choose an item, put the node in session and navigate to the item.navigateUrl.
My trouble is to put the node in session.
I've tryed to use the OnContextMenuItemClick event and this puts the node in session but looses the capability of navigate to the item specified url
protected void OnContextMenuItemClick(Object sender, RadTreeViewContextMenuEventArgs e){
Session["TreeNode"]=(RadTreeNode)e.Node;
}
If i do the following, i loose the item.Target hability.
protected void OnContextMenuItemClick(Object sender, RadTreeViewContextMenuEventArgs e){
Session["TreeNode"]=(RadTreeNode)e.Node;
Response.Redirect(e.ItemMenu.navigateUrl);
}
In the end what a want is to navigate to another page, but this page should open in the specified target and have the node information in that page.
Without have to build a menu for each treeNode. Because if i do that everything works fine.
Can someone englight me on the path to follow? If anymore information needed please ask me.
By the way i'm using IE8 and the version of Telerik Controls is 2009.2.286.
Thanks in advance.
Nuno Chumbo
. . . <div> <div style="font-size: 15px"> <b>Manage records</b> </div> <br /> <div> <b>ADD New Record: </b> <telerik:RadComboBox ID="ddl2" runat="server" EmptyMessage="Type a Record" DataSourceID="SqlDataSource6" DataTextField="name" DataValueField="id" Skin="Web20"> </telerik:RadComboBox> . . . <style type="text/css" > div, td, span,li ,ul { -moz-box-sizing:border-box; box-sizing:border-box; } </style><%@ Page Language="VB" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="false" CodeFile="TeacherRole.aspx.vb" Inherits="Admin_TeacherRole" title="Untitled Page" %><%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %><asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server"> <html><body> <!-- content start --> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function RowDblClick(sender, eventArgs) { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); } </script> </telerik:RadCodeBlock><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" OnUpdateCommand = "RadGrid1_UpdateCommand" AutoGenerateEditColumn="True" GridLines="None" Skin="Black" AllowAutomaticUpdates="True" ShowGroupPanel="True" GroupPanel-ID = "RadAjaxLoadingPanel1"> <MasterTableView EditMode="PopUp" AutoGenerateColumns="False" DataKeyNames = "user_id" CommandItemDisplay="Top"> <Columns> <telerik:GridBoundColumn DataField="user_id" DataType="System.Int32" HeaderText="User ID" SortExpression="user_id" UniqueName="user_id" ReadOnly="True"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="lastname" HeaderText="Last Name" SortExpression="lastname" UniqueName="lastname" ReadOnly="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="firstname" HeaderText="First Name" SortExpression="firstname" UniqueName="firstname" ReadOnly="False"> </telerik:GridBoundColumn> </Columns> <EditFormSettings CaptionFormatString="Edit User ID: {0}" CaptionDataField="user_id" PopUpSettings-Modal="True" PopUpSettings-ScrollBars="Auto" EditFormType= "AutoGenerated"> <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle> <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle> <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle> <EditColumn ButtonType="PushButton" /> <PopUpSettings ScrollBars="Auto" Modal="True"></PopUpSettings> </EditFormSettings> </MasterTableView> <ClientSettings AllowDragToGroup="True"> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> <ClientEvents OnRowDblClick="RowDblClick" /> </ClientSettings> </telerik:RadGrid> <!-- content end --></body></html></asp:Content>
Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Globalization
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Partial Class Admin_TeacherRole
Inherits System.Web.UI.Page
Private Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
If Not IsPostBack Then
For Each item As GridItem In RadGrid1.MasterTableView.Items
If TypeOf item Is GridEditableItem Then
Dim editableItem As GridEditableItem = CType(item, GridDataItem)
editableItem.Edit = True
End If
Next
RadGrid1.Rebind()
End If
End Sub
Private Sub Page_PreRender(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
If Not MyBase.IsPostBack Then
Me.RadGrid1.MasterTableView.Items(0).Edit = True
Me.RadGrid1.MasterTableView.Rebind()
End If
End Sub
Public ReadOnly Property UserData() As DataSet
Get
Dim obj As Object = Me.Session("UserData")
If Not obj Is Nothing Then
Return CType(obj, DataSet)
End If
Dim MyUserData As DataSet = New DataSet
Dim ConnString As String = ConfigurationManager.ConnectionStrings("ProLearnConnectionString").ConnectionString
Dim conn As SqlConnection = New SqlConnection(ConnString)
Dim adapter As SqlDataAdapter = New SqlDataAdapter
adapter.SelectCommand = New SqlCommand("SELECT user_id, lastname, firstname FROM tblStudents ORDER BY user_id", conn)
adapter.Fill(MyUserData, "tblStudents")
Me.Session("UserData") = MyUserData
Return MyUserData
End Get
End Property
Private Sub RadGrid1_NeedDataSource(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
RadGrid1.DataSource = Me.UserData
Me.UserData.Tables("tblStudents").PrimaryKey = New DataColumn() {Me.UserData.Tables("tblStudents").Columns("user_id")}
End Sub
Protected Sub RadGrid1_UpdateCommand(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim editMan As GridEditManager = editedItem.EditManager
Dim column As GridColumn
For Each column In e.Item.OwnerTableView.Columns
If TypeOf column Is IGridEditableColumn Then
Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn)
If (editableCol.IsEditable) Then
Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol)
Dim editorType As String = CType(editor, Object).ToString()
Dim editorText As String = "unknown"
Dim editorValue As Object = Nothing
If (TypeOf editor Is GridTextColumnEditor) Then
editorText = CType(editor, GridTextColumnEditor).Text
editorValue = CType(editor, GridTextColumnEditor).Text
End If
If (TypeOf editor Is GridBoolColumnEditor) Then
editorText = CType(editor, GridBoolColumnEditor).Value.ToString()
editorValue = CType(editor, GridBoolColumnEditor).Value
End If
If (TypeOf editor Is GridDropDownColumnEditor) Then
editorText = CType(editor, GridDropDownColumnEditor).SelectedText & "; " & CType(editor, GridDropDownColumnEditor).SelectedValue
editorValue = CType(editor, GridDropDownColumnEditor).SelectedValue
End If
Try
Dim changedRows As DataRow() = Me.UserData.Tables("tblStudents").Select("user_id = " & editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("user_id"))
changedRows(0)(column.UniqueName) = editorValue
Me.UserData.Tables("tblStudents").AcceptChanges()
Catch ex As Exception
RadGrid1.Controls.Add(New LiteralControl("<strong>Unable to set value of column '" & column.UniqueName & "'</strong> - " + ex.Message))
e.Canceled = True
End Try
End If
End If
Next
End Sub
End Class

<telerik:RadGrid ID="ClassGrid" runat="server" AllowMultiRowSelection="false" AutoGenerateColumns="False" OnNeedDataSource="ClassGrid_NeedDataSource" OnDataBound="ClassGrid_DataBound" Skin="WebBlue" GridLines="Both" ShowGroupPanel="false" ShowHeader="true" OnItemDataBound="ClassGrid_ItemDataBound" AllowPaging="true" PageSize="10" AllowFilteringByColumn="true"> <ExportSettings FileName="AvailableClassListExport" ExportOnlyData="true" OpenInNewWindow="True" HideStructureColumns="true"> </ExportSettings> <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" PagerStyle-AlwaysVisible="true"> <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowExportToWordButton="true" ShowExportToPdfButton="true" /> <RowIndicatorColumn Visible="True"> </RowIndicatorColumn> <ItemTemplate> <div style="float:left; padding: 0px 15px 0px 0px"> <span><b> <%#Eval("Class_Date", "{0:MMM dd, yyyy}")%></b> <br /> <%#Eval("Class_Start_Time").ToString()%> - <%#Eval("Class_End_Time").ToString()%> <br /><br /><br /><br /><br /> </span> </div> <div> <span><b> <%# Container.DataItem("Location_Name") %></b> <%#IIf(Container.DataItem("isSpanish") = "Y", " (Spanish)", " (English)")%> <br /> <%# Container.DataItem("Street_Address") %> <br /> <%# Container.DataItem("City") %>, <%# Container.DataItem("FK_State_Code") %> <%# Container.DataItem("Zip") %> <br /> <b>Cross Streets:</b> <%# container.DataItem("Cross_Streets") %> <br /> <!-- Map --> <%#"<a href=""http://www.mapquest.com/maps?city=" + Container.DataItem("City") + "&state=" + Container.DataItem("FK_State_Code") + "&address=" + Container.DataItem("Street_Address") + "&zipcode=" + Container.DataItem("Zip") + "&country=US&CID=lfmaplink"" target=""_Blank"">Map</a>"%> <!-- Seperator --> | <!-- Directions --> <%#"<a href=""http://www.mapquest.com/maps?2c=" + Container.DataItem("City") + "&2s=" + Container.DataItem("FK_State_Code") + "&2a=" + Container.DataItem("Street_Address") + "&2z=" + Container.DataItem("Zip") + "&2y=US&Form=directions&CID=lfddlink"" target=""_Blank"">Directions</a>"%> <br /> <br /> </span> </div> </ItemTemplate> <Columns> <telerik:GridBoundColumn DataField="Class_ID" Display="false" HeaderText="ID"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn UniqueName="Class_Date" DataField="Class_Date" Display="true" HeaderText="Date" AllowFiltering="true" PickerType="DatePicker" ItemStyle-Width="200px"> </telerik:GridDateTimeColumn> <telerik:GridBoundColumn DataField="Class_Start_Time" Display="false" HeaderText="Start Time" AllowFiltering="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Class_End_Time" Display="false" HeaderText="End Time" AllowFiltering="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Location_Name" Display="false" HeaderText="Location"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Street_Address" Display="false" HeaderText="Address"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="City" Display="false" HeaderText="_City"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FK_State_Code" Display="false" HeaderText="State"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn DataField="Zip" Display="false" HeaderText="Zip"> </telerik:GridDateTimeColumn> <telerik:GridBoundColumn DataField="Class_Status" Display="false" HeaderText="Status"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="isSpanish" Display="false" HeaderText="Spanish" AllowFiltering="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Location_DisplayCity" Display="false" HeaderText="City" AllowFiltering="true"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"> <Selecting AllowRowSelect="True"></Selecting> <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing> </ClientSettings> <GroupingSettings ShowUnGroupButton="true" /> <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" /></telerik:RadGrid><script type="text/javascript"> window.setTimeout("TEST();", 5000); function TEST() { var _ClassGrid = $find("<%= AZADDClassGrid.ClientID %>_ClassGrid"); var _MasterTable = _ClassGrid.get_masterTableView(); var _SelectedRows = _ClassGrid.get_selectedItems(); if (_SelectedRows.length > 0) { for (var i = 0; i < _SelectedRows.length; i++) { var record = _SelectedRows[i]; var classDate = new Date(_MasterTable.getCellByColumnUniqueName(record, "Class_Date")); alert(_MasterTable.getCellByColumnUniqueName(record, "Class_ID").innerHTML); } } } </script>