| LiteralControl script = (LiteralControl)radScriptBlock.Controls[0]; |
| script.Text = "UpdateMainWindow('" + Session["IdM_btnUpdate_ClientID"].ToString() + "');"; |
' MyProfile RadWindow
MyProfileHyperLink.NavigateUrl =
"MyProfileViewDetails.aspx"
Dim MyProfileHyperLinkWindowName As String = "MyProfile"
Dim clickEventHandlerStringMyProfileHyperLink As String = "javascript:var w = window.radopen('" & _
Convert.ToString("MyProfileViewDetails.aspx") & "', '" & _
MyProfileHyperLinkWindowName & "'); w.set_modal(false); w.moveTo(100, 100); w.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move +Telerik.Web.UI.WindowBehaviors.Close); w.setSize(900, 400); return false;"
MyProfileHyperLink.Attributes.Add("onclick", clickEventHandlerStringMyProfileHyperLink)
Anyway to add Transparency to a window opened this way?
Thanks
protected void radgridAccount_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item.OwnerTableView.Name == "Orders")
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{GridEditableItem item = e.Item as GridEditableItem;
if (item.IsInEditMode)
{
//either these lines
this.radgridAccount.MasterTableView.DetailTables[0].Columns[1].Visible = false;this.radgridAccount.MasterTableView.DetailTables[0].Columns[2].Visible = false;
//or these lines
Item["A"].Controls[0].Visible = false;
item["B"].Controls[0].Visible = true;
}}}}
Thanks.
d-cpt
| <telerik:raddocklayout runat="server" id="RadDockLayout1" |
| onsavedocklayout="RadDockLayout1_SaveDockLayout" |
| onloaddocklayout="RadDockLayout1_LoadDockLayout"> |
| <table cellspacing="5" cellpadding="5" border="0" width="690"> |
| <tr> |
| <td> |
| <telerik:RadDockZone ID="RadDockZone1" runat="server" Width="330px" MinHeight="243px" MinWidth="330px"> |
| </telerik:RadDockZone> |
| </td> |
| <td> |
| <telerik:RadDockZone ID="RadDockZone2" runat="server" Width="330px" MinHeight="243px" MinWidth="330px"> |
| </telerik:RadDockZone> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> |
| <div style="display:none"> |
| Hidden UpdatePanel, which is used to receive the new dock controls. |
| We will move them with script to the desired initial dock zone. |
| <asp:updatepanel runat="server" id="UpdatePanel1"> |
| </asp:updatepanel> |
| </div> |
| </td> |
| </tr> |
| </table> |
| </telerik:raddocklayout> |
| using System; |
| using System.Collections; |
| using System.Collections.Generic; |
| using System.ComponentModel; |
| using System.Data; |
| using System.Drawing; |
| using System.Web; |
| using System.Web.SessionState; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.HtmlControls; |
| using Telerik.Web.UI; |
| using System.Data.SqlClient; |
| using System.Configuration; |
| using System.Text; |
| public partial class Portal : System.Web.UI.Page |
| { |
| private SqlConnection _conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DockConnectionString"].ConnectionString); |
| private int _count = 0; |
| bool LoadDefaults = true; |
| protected void Page_Init(object sender, EventArgs e) |
| { |
| LoadDefaults=true; |
| if (LoadDefaults) |
| LoadDefaultsFromSharePoint(); |
| else |
| LoadFromDatabase(); |
| } |
| private void LoadDefaultsFromSharePoint() |
| { |
| string[] WidgetTitles = { "ECAMPAIGNS","NEWS","MY LISTINGS","MY CALENDAR"}; |
| string[] WidgetControls = { "HP_eCampaign.ascx", "HP_News.ascx", "HP_Listings.ascx", "HP_Calendar.ascx"}; |
| //Recreate the docks in order to ensure their proper operation |
| bool isZoneOne=true; |
| int i = 0; |
| foreach (string widget in WidgetTitles) |
| { |
| RadDock dock = CreateRadDock(widget, WidgetControls[i]); |
| //We will just add the RadDock control to the RadDockLayout. |
| // You could use any other control for that purpose, just ensure |
| // that it is inside the RadDockLayout control. |
| // The RadDockLayout control will automatically move the RadDock |
| // controls to their corresponding zone in the LoadDockLayout |
| // event (see below). |
| if (isZoneOne) |
| { |
| isZoneOne=false; |
| RadDockZone1.Docks.Add(dock); |
| } |
| else |
| { |
| isZoneOne=true; |
| RadDockZone2.Docks.Add(dock); |
| } |
| //We want to save the dock state every time a dock is moved. |
| CreateSaveStateTrigger(dock); |
| i++; |
| } |
| } |
| private void LoadFromDatabase() |
| { |
| string dockState = ""; |
| try |
| { |
| _conn.Open(); |
| SqlCommand command = new SqlCommand("select State from States where id=1", _conn); |
| dockState = command.ExecuteScalar().ToString(); |
| _conn.Close(); |
| } |
| catch |
| { |
| } |
| string[] currentDockStates = dockState.Split('|'); |
| _count = currentDockStates.Length; |
| //Recreate the docks in order to ensure their proper operation |
| for (int i = 0; i < _count; i++) |
| { |
| if (currentDockStates[i].Trim() != string.Empty) |
| { |
| RadDock dock = CreateRadDockFromState(currentDockStates[i]); |
| //We will just add the RadDock control to the RadDockLayout. |
| // You could use any other control for that purpose, just ensure |
| // that it is inside the RadDockLayout control. |
| // The RadDockLayout control will automatically move the RadDock |
| // controls to their corresponding zone in the LoadDockLayout |
| // event (see below). |
| RadDockLayout1.Controls.Add(dock); |
| //We want to save the dock state every time a dock is moved. |
| CreateSaveStateTrigger(dock); |
| } |
| } |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| private RadDock CreateRadDockFromState(string stringState) |
| { |
| System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); |
| DockState state = serializer.Deserialize<DockState>(stringState); |
| RadDock dock = new RadDock(); |
| dock.ID = string.Format("RadDock{0}", state.UniqueName); |
| dock.ApplyState(state); |
| return dock; |
| } |
| private RadDock CreateRadDock(string WidgetTitle, string WidgetControlName) |
| { |
| RadDock dock = new RadDock(); |
| dock.UniqueName = Guid.NewGuid().ToString(); |
| dock.ID = string.Format("RadDock{0}", dock.UniqueName); |
| dock.Title = WidgetTitle; |
| dock.Width = Unit.Pixel(330); |
| dock.Height = Unit.Pixel(243); |
| try |
| { |
| Control widget = LoadControl(WidgetControlName); |
| } |
| catch (Exception ex) |
| { |
| dock.Text = string.Format("Error in Widget: {0}", ex.Message); |
| } |
| //dock.DefaultCommands= |
| return dock; |
| } |
| private void CreateSaveStateTrigger(RadDock dock) |
| { |
| //Ensure that the RadDock control will initiate postback |
| // when its position changes on the client or any of the commands is clicked. |
| //Using the trigger we will "ajaxify" that postback. |
| dock.AutoPostBack = true; |
| dock.CommandsAutoPostBack = true; |
| AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger(); |
| saveStateTrigger.ControlID = dock.ID; |
| saveStateTrigger.EventName = "DockPositionChanged"; |
| UpdatePanel1.Triggers.Add(saveStateTrigger); |
| } |
| protected void RadDockLayout1_SaveDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e) |
| { |
| string dockState; |
| System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); |
| List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState(); |
| StringBuilder serializedList = new StringBuilder(); |
| int i = 0; |
| while (i < stateList.Count) |
| { |
| serializedList.Append(serializer.Serialize(stateList[i])); |
| serializedList.Append("|"); |
| i++; |
| } |
| dockState = serializedList.ToString(); |
| if (dockState.Trim() != String.Empty) |
| { |
| try |
| { |
| _conn.Open(); |
| SqlCommand command = new SqlCommand(String.Format("update States set State='{0}' where id=1", dockState), _conn); |
| command.ExecuteNonQuery(); |
| _conn.Close(); |
| } |
| catch |
| { |
| } |
| } |
| //Save the dockState string into DB |
| } |
| protected void RadDockLayout1_LoadDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e) |
| { |
| if (!LoadDefaults) // Perform this task only when not loading defaults,I.E when reading from database |
| { |
| System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); |
| //Get saved state string from the database - set it to dockState variable for example |
| string dockState = ""; |
| try |
| { |
| _conn.Open(); |
| SqlCommand command = new SqlCommand("select State from States where id=1", _conn); |
| dockState = command.ExecuteScalar().ToString(); |
| _conn.Close(); |
| } |
| catch |
| { |
| } |
| string[] currentDockStates = dockState.Split('|'); |
| foreach (string stringState in currentDockStates) |
| { |
| if (stringState.Trim() != string.Empty) |
| { |
| DockState state = serializer.Deserialize<DockState>(stringState); |
| e.Positions[state.UniqueName] = state.DockZoneID; |
| e.Indices[state.UniqueName] = state.Index; |
| } |
| } |
| } |
| } |
| } |

In trying to get the menu control to add a border and highlight the item under the mouse, I've run into an issue with text being dropped to a new line and the item size increasing vertically. It seems to be an issue with the padding of rmItem. If I add even one pixel of padding to the item--as is done in the embedded Outlook skin--I see the issue. I'm including stylesheet excerpts with changed portions for a version that does not have the problem (border and padding commented out) and one that does.
Version with border (and problem):
--
Image sample showing the issue
.rmRootGroup .rmItem
{
/* with inset border */
padding:1px;
width:100%;
}
.RadMenu_Activate .rmVertical .rmExpanded,
.RadMenu_Activate .rmVertical .rmExpanded:hover
{
background:#93B5E7 left top repeat-x;
/* with inset border */
border:1px solid #002D96;
}
/* with inset border */
.RadMenu_Activate .rmGroup .rmLink
{
padding:1px;
}
.RadMenu_Activate .rmGroup .rmLink:hover,
.RadMenu_Activate .rmGroup .rmFocused,
.RadMenu_Activate .rmGroup .rmExpanded
{
background-color:#FFEEC2;
background-image:none;
border-left: 0px;
/* with inset border */
padding: 0px;
border:1px solid #002D96;
}
Version without border (and without the problem)
--
Image sample showing how the text should be displayed
.rmRootGroup .rmItem
{
/* with inset border
padding:1px; */
width:100%;
}
.RadMenu_Activate .rmVertical .rmExpanded,
.RadMenu_Activate .rmVertical .rmExpanded:hover
{
background:#93B5E7 left top repeat-x;
/* with inset border
border:1px solid #002D96;*/
}
/* with inset border
.RadMenu_Activate .rmGroup .rmLink
{
padding:1px;
}
*/
.RadMenu_Activate .rmGroup .rmLink:hover,
.RadMenu_Activate .rmGroup .rmFocused,
.RadMenu_Activate .rmGroup .rmExpanded
{
background-color:#FFEEC2;
background-image:none;
border-left: 0px;
/* with inset border
padding: 0px;
border:1px solid #002D96;*/
}
And as I mentioned earlier, even the embedded Outlook skin creates the same unwanted new line: