or
<telerik:RadWindowManager ID="RadWindowManagerMain" runat="server" RestrictionZoneID="center" Behaviors="Close, Maximize, Minimize, Move, Resize" KeepInScreenBounds="true" VisibleStatusbar="false" EnableShadow="true" Animation="Fade" AnimationDuration="300" AutoSize="false" VisibleOnPageLoad="false" IconUrl="../CSS/titlegraphic.gif" ShowContentDuringLoad="true" OnClientDragStart="WindowDragStart" OnClientCommand="OnClientCommand" OnClientActivate="OnClientActivate" OnClientClose="OnClientClose" EnableViewState="true"> </telerik:RadWindowManager>
<radW:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Office2007"> </radW:RadWindowManager> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <radspl:RadSplitter Width="100%" Height="100%" ID="RadSplitter1" runat="server" Orientation="Horizontal" Skin="Office2007" VisibleDuringInit="false"> <radspl:RadPane ID="RadPane1" runat="server" Height="167" MinHeight="79"> <radG:RadGrid ID="RadGrid1" runat="server" PageSize="5" AllowSorting="true" EnableAJAXLoadingTemplate="true" AllowPaging="true" AutoGenerateColumns="False" EnableAJAX="True"
GridLines="None" Skin="Office2007"> <AJAXLoadingTemplate> <asp:Panel ID="Panel1" Width="100%" Height="100%" runat="server"> <img src="Images/Loading.gif" style="z-index: 100" /> </asp:Panel> </AJAXLoadingTemplate> <ExportSettings IgnorePaging="True" OpenInNewWindow="True" /> <PagerStyle Mode="NextPrevAndNumeric" /> <MasterTableView DataKeyNames="ID" AllowPaging="true" AllowSorting="true"> <Columns> <radG:GridBoundColumn DataField="ID" UniqueName="ID" Display="false"> </radG:GridBoundColumn> <radG:GridBoundColumn DataField="Name" UniqueName="Name"> </radG:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings ApplyStylesOnClient="True" EnableClientKeyValues="True"> <Selecting AllowRowSelect="True" /> <ClientEvents OnGridCreated="GridCreated" OnRequestStart="GridRequestStart" OnRowContextMenu="ContextMenu" /> </ClientSettings> </radG:RadGrid> </radspl:RadPane> </radspl:RadSplitter>objRadMenu.WebServiceSettings.Path = "../Service/SNetService.asmx"; objRadMenu.WebServiceSettings.Method = "GetUserLinkHistory"; objRadMenu.OnClientItemPopulating = "ShowImage"; objRadMenu.OnClientItemPopulated = "HideImage"; objRadMenu.OnClientItemClosed = "ChildMenuClosed"; objRadMenu.OnClientMouseOver = "ShowToolTip"; RadMenuItem objRadMenuToday = new RadMenuItem(ResourceLang.GetString("Today", "MySettings.aspx")); objRadMenuToday.ExpandMode = MenuItemExpandMode.WebService;
function ChildMenuClosed(sender, args) { try { var item = args.get_item(); var varItemID = item.get_attributes().getAttribute("PKID"); if (varItemID == "5") //Clearing Today Data only { item.set_expandMode(Telerik.Web.UI.MenuItemExpandMode.WebService); item.get_items().clear(); item._itemsLoaded = false; } } catch (exp) { } }
<telerik:RadEditor ID="re1" runat="server"> </telerik:RadEditor><html> <head> <style> span{ color: red !important; } div { color: blue !important; } </style> </head> <body> <span>should be red</span> <div>should be blue</div> </body> </html>
Customer.aspx: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="customers.aspx.cs" Inherits="customers" %> <%@ Register Src="assignusers.ascx" TagName="ProductDetails" TagPrefix="uc1" %> <!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"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Windows7" /> <telerik:RadAjaxManager ID="AjaxManager1" runat="server" EnablePageHeadUpdate="false"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1"/> <telerik:AjaxUpdatedControl ControlID="Literal1" /> <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="ManualClose" Width="620" Height="230" runat="server" EnableShadow="true" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element" Position="MiddleRight" Modal="true"> </telerik:RadToolTipManager> <asp:Literal ID="Literal1" runat="server" Text="" /> <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" DataSourceID="EntityDataSource1" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowPaging="true" PageSize="10" EnableLinqExpressions="false" OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"> <MasterTableView DataKeyNames="id" CommandItemDisplay="Top" EditMode="PopUp"> <EditFormSettings CaptionFormatString="Add/Edit Customers" PopUpSettings-Modal="true" EditFormType="WebUserControl" UserControlName="editcustomer.ascx" PopUpSettings-Width="700px"> </EditFormSettings> <Columns> <telerik:GridButtonColumn ButtonType="LinkButton" Text="edit" CommandName="Edit" /> <telerik:GridButtonColumn ButtonType="LinkButton" Text="delete" CommandName="Delete" /> <telerik:GridBoundColumn DataField="name" HeaderText="Name" /> <telerik:GridTemplateColumn UniqueName="AssignUsers"> <ItemTemplate> <asp:HyperLink ID="targetControl" runat="server" NavigateUrl="#" Text="Assign Users" /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid> </div> <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=EntityFrameworkTestEntities" DefaultContainerName="EntityFrameworkTestEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Customers" Include="Users" OnDeleted="EntityDataSource1_Deleted" OnInserting="EntityDataSource1_Inserting" OnUpdating="EntityDataSource1_Updating" OnInserted="EntityDataSource1_Inserted" OnUpdated="EntityDataSource1_Updated" ViewStateMode="Enabled"> </asp:EntityDataSource> </form> </body> </html> assignusers.ascx: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="assignusers.ascx.cs" Inherits="assignusers" %> <%@ Import Namespace="Telerik.Web.UI" %> <div> <table> <tr> <td>Users <b>NOT</b> Assigned To This Customer</td> <td>Users Assigned To This Customer</td> </tr> <tr> <td> <telerik:RadListBox ID="RadListBox1" runat="server" Width="300px" Height="200px" AutoPostBack="false" SelectionMode="Single" AllowTransfer="true" TransferToID="RadListBox2" AutoPostBackOnTransfer="true" EnableDragAndDrop="true" AllowReorder="false"> </telerik:RadListBox> </td> <td> <telerik:RadListBox ID="RadListBox2" runat="server" Width="300px" Height="200px" AutoPostBack="false" SelectionMode="Single" AllowReorder="false" EnableDragAndDrop="true" AutoPostBackOnTransfer="true" AllowTransfer="true" TransferToID="RadListBox1" OnDeleting="RadListBox2_Deleting" OnInserting="RadListBox2_Inserting"> </telerik:RadListBox> </td> </tr> </table> </div> assignusers.ascx.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections.Specialized; using Telerik.Web.UI; public partial class assignusers : System.Web.UI.UserControl { public int Id { get { return Convert.ToInt32(ViewState["id"]); } set { ViewState["id"] = value.ToString(); } } protected void Page_Load(object sender, EventArgs e) { RadListBox1.Items.Clear(); RadListBox2.Items.Clear(); using (var context = new EntityFrameworkTestModel.EntityFrameworkTestEntities()) { if (RadListBox2.DataSource == null) { var customer = context.Customers.First(p => p.id == Id); RadListBox2.DataSource = customer.Users.ToList(); RadListBox2.DataKeyField = "id"; RadListBox2.DataTextField = "name"; RadListBox2.DataValueField = "id"; RadListBox2.DataBind(); } if (RadListBox1.Items.Count == 0) { var users = from u in context.Users orderby u.name select u; foreach (var user in users) { if (RadListBox2.FindItemByValue(user.id.ToString()) == null) { RadListBoxItem _item = new RadListBoxItem(user.name, user.id.ToString()); RadListBox1.Items.Add(_item); } } } } } protected void RadListBox2_Deleting(object sender, RadListBoxDeletingEventArgs e) { using (var context = new EntityFrameworkTestModel.EntityFrameworkTestEntities()) { var customer = context.Customers.First(p => p.id == Id); foreach (RadListBoxItem item in e.Items) { int _itemid = Convert.ToInt32(item.Value); var user = context.Users.First(u => u.id == _itemid); customer.Users.Remove(user); } context.SaveChanges(); } } protected void RadListBox2_Inserting(object sender, RadListBoxInsertingEventArgs e) { using (var context = new EntityFrameworkTestModel.EntityFrameworkTestEntities()) { var customer = context.Customers.First(p => p.id == Id); foreach (RadListBoxItem item in e.Items) { int _itemid = Convert.ToInt32(item.Value); var user = context.Users.First(u => u.id == _itemid); customer.Users.Add(user); } context.SaveChanges(); } } }