Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
134 views
Adding anchor control to the titlebarcontainer of the dock does not display expand/collapse and close buttons in IE9 & IE10. It works perfectly in Firefox and Chrome.

I am attaching all the code and the screenshots related to this issue. Please let me know what I am missing. It was working fine with the trial version.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Dashboard1.ascx.cs" Inherits="Desktop_Controls_Dashboard1" %><br><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><br><%@ Reference VirtualPath="~/Desktop/Controls/Widgets/MonthlyMachineChart.ascx" %><br><br><telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Metro" <br>     OnSaveDockLayout="RadDockLayout1_SaveDockLayout" ><br>    <table><br>        <tr><br>            <%--<td style="width:20px">&nbsp;&nbsp;</td>--%><br>            <td style="vertical-align: top">                <br>                <telerik:RadDockZone ID="RadDockZone0" runat="server" Orientation="Vertical" Width="420px" <br>                    MinHeight="400px" Style="float: left; margin-right: 20px;"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>            <td style="vertical-align: top"><br>                <telerik:RadDockZone ID="RadDockZone1" runat="server" Orientation="Vertical" Width="420px"<br>                    MinHeight="400px" Style="float: left; margin-right: 20px;"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>            <td style="vertical-align: top"><br>                <telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Width="420px"<br>                    MinHeight="400px"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>        </tr><br>    </table><br></telerik:RadDockLayout>


using System;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Web;<br>using System.Web.UI;<br>using System.Web.UI.WebControls;<br>using System.Web.UI.HtmlControls;<br>using AzimaDLI;<br>using AzimaDLI.Users;<br>using Telerik.Web.UI;<br>using System.Text;<br><br>public partial class Desktop_Controls_Dashboard1 : BaseControl<br>{<br>    public int selectedPlantId = 0;<br>    private string connString = string.Empty;<br>    User thisUser = null;<br><br>    //Store the info about the added docks in the session.<br>    private List<DockState> CurrentDockStates<br>    {<br>        get<br>        {<br>            List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStates"];<br>            if (Object.Equals(_currentDockStates, null))<br>            {<br>                _currentDockStates = new List<DockState>();<br>                Session["CurrentDockStates"] = _currentDockStates;<br>            }<br>            return _currentDockStates;<br>        }<br>        set<br>        {<br>            Session["CurrentDockStates"] = value;<br>        }<br>    }<br><br>    protected void Page_Init(object sender, EventArgs e)<br>    {     <br>        if (Session != null)<br>        {<br>            connString = Session["ConnString"].ToString();<br>            thisUser = ((User)Session["User"]);<br>            selectedPlantId = Convert.ToInt32(Session["SelectedPlantId"]);<br>        }<br><br>        LoadWidgets();<br>        //if (Page.IsPostBack)<br>        //{<br>        //    //UpdateLayoutState();<br>        //    //Recreate the docks in order to ensure their proper operation<br>        //    for (int i = 0; i < CurrentDockStates.Count; i++)<br>        //    {<br><br>        //        RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);<br>        //        //We will just add the RadDock control to the RadDockLayout.<br>        //        // You could use any other control for that purpose, just ensure<br>        //        // that it is inside the RadDockLayout control.<br>        //        // The RadDockLayout control will automatically move the RadDock<br>        //        // controls to their corresponding zone in the LoadDockLayout<br>        //        // event (see below).<br>        //        RadDockLayout1.Controls.Add(dock);<br>        //        //We want to save the dock state every time a dock is moved.<br>        //        CreateSaveStateTrigger(dock);<br>        //        //Load the selected widget<br>        //        if (string.IsNullOrEmpty(dock.Tag) || dock.Closed)<br>        //        {<br>        //            return;<br>        //        }<br>        //        Control widget = LoadControl(dock.Tag);<br>        //        dock.ContentContainer.Controls.Add(widget);<br><br>        //        if (CurrentDockStates[i].Closed == true)<br>        //        {<br>        //            dock.Visible = false;<br>        //        }<br>        //    }<br>        //}<br>        //else<br>        //{<br>        //    LoadWidgets();<br>        //}<br>    }<br><br>    protected void Page_Load(object sender, EventArgs e)<br>    {<br>        <br>    }<br><br>    private void LoadWidgets()<br>    {<br>        //get the list of widgets that the user has<br>        List<WidgetUser> widgetList = WidgetUser.GetWidgetsByPortalUserId(thisUser.PortalUserId, connString);<br>        string title = string.Empty;<br>        string tag = string.Empty;<br>        string onclick = string.Empty;<br>        string href = string.Empty;<br>        HtmlAnchor anchor = new HtmlAnchor();<br>        <br>        //loop through the widgetList<br>        foreach (WidgetUser item in widgetList)<br>        {<br>            switch (item.WidgetId)<br>            {<br>                // customer widget<br>                case 1:<br>                    tag = "~/Desktop/Controls/Widgets/CustomerInfo.ascx";<br>                    title = Session["CID"].ToString();<br>                    CreateWidget(item, tag, title, null);                    <br>                    break;<br>                case 2:<br>                    tag = "~/Desktop/Controls/Widgets/WatchList.ascx";<br>                    anchor = GetAnchor("plus", "goToWatchList();", item.WidgetName, "javascript:void(0)");<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 3:<br>                    tag = "~/Desktop/Controls/Widgets/ManualCollection.ascx";<br>                    href = string.Format("~/Desktop/Reports/MachinesBySeverity.aspx?PlantId={0}&AreaId=0&MachType=manual", selectedPlantId);<br>                    anchor = GetAnchor("collect", onclick, item.WidgetName, href);<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 4:<br>                    tag = "~/Desktop/Controls/Widgets/OnlineCollection.ascx";<br>                    href = string.Format("~/Desktop/Reports/MachinesBySeverity.aspx?PlantId={0}&AreaId=0&MachType=online", selectedPlantId);<br>                    anchor = GetAnchor("collect", onclick, item.WidgetName, href);<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 5:<br>                    tag = "~/Desktop/Controls/Widgets/DataCollection.ascx";<br>                    href = string.Format("~/Desktop/Reports/OverdueMachines.aspx?PlantId={0}&AreaId=0", selectedPlantId);<br>                    anchor = GetAnchor("collect", onclick, item.WidgetName, href);<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 6:<br>                    tag = "~/Desktop/Controls/Widgets/MonthlyMachineChart.ascx";<br>                    CreateMonthlyMachWidget(item, tag, "", "sevtrend");<br>                    break;<br>                case 7:<br>                    tag = "~/Desktop/Controls/Widgets/MonthlyMachineChart.ascx";<br>                    CreateMonthlyMachWidget(item, tag, "", "nofaults");<br>                    break;<br>            }            <br>        }<br>    }<br><br>    private HtmlAnchor GetAnchor(string cssclass, string onclick, string text, string href)<br>    {<br>        HtmlAnchor anch = new HtmlAnchor();<br>        anch.Attributes.Add("class", cssclass);<br>        if (onclick != string.Empty)<br>        {<br>            anch.Attributes.Add("onclick", onclick);<br>        }<br>        anch.InnerHtml = text;<br>        anch.HRef = href;<br>        return anch;<br>    }<br><br>    private void CreateMonthlyMachWidget(WidgetUser item, string tag, string title, string chartType)<br>    {<br>        //string id = string.Format("Raddock{0}", item.WidgetId);<br>        RadDock dock = CreateRadDock(title, 425, item, tag);<br><br>        MonthlyMachineChart chartControl = (MonthlyMachineChart) LoadControl(dock.Tag);<br>        chartControl.ChartType = chartType;<br>        chartControl.CurrentUser = thisUser;<br>        string href = chartControl.TitleLink;<br>        dock.ContentContainer.Controls.Add(chartControl);<br><br>        //string href = string.Empty; // chartControl.GetTitleLink();<br>        HtmlAnchor anchor = GetAnchor("collect", "", item.WidgetName, href);<br>        //titlebarContainer<br>        if (anchor != null)<br>        {<br>            dock.TitlebarContainer.Controls.Add(anchor);<br>        }<br>        AddDocktoZone(item.Column, dock);<br><br>        CreateSaveStateTrigger(dock);<br>    }<br><br>    private void CreateWidget(WidgetUser item, string tag, string title, HtmlAnchor anchor)<br>    {<br>        //string id = string.Format("Raddock{0}", item.WidgetId);<br>        RadDock dock = CreateRadDock(title, 420, item, tag);<br>        <br>        // content<br>        Control widget = LoadControl(dock.Tag);<br>        dock.ContentContainer.Controls.Add(widget);<br><br>        //titlebarContainer<br>        if (anchor != null)<br>        {<br>            dock.TitlebarContainer.Controls.Add(anchor);<br>        }<br>        AddDocktoZone(item.Column, dock);<br><br>        CreateSaveStateTrigger(dock);<br>    }<br><br>    private void AddDocktoZone(int column, RadDock dock)<br>    {<br>        if (column == 0)<br>        {<br>            RadDockZone0.Controls.Add(dock);<br>        }<br>        else if (column == 1)<br>        {<br>            RadDockZone1.Controls.Add(dock);<br>        }<br>        else if (column == 2)<br>        {<br>            RadDockZone2.Controls.Add(dock);<br>        }<br>    }<br><br>    private void CreateSaveStateTrigger(RadDock dock)<br>    {<br>        //Ensure that the RadDock control will initiate postback<br>        // when its position changes on the client or any of the commands is clicked.<br>        //Using the trigger we will "ajaxify" that postback.<br>        dock.AutoPostBack = true;<br>        dock.CommandsAutoPostBack = true;<br>    }<br><br>    private RadDock CreateRadDock(string title, int width, WidgetUser item, string tag)<br>    {<br>        RadDock dock = new RadDock();<br>        dock.DockMode = DockMode.Docked;<br>        dock.UniqueName = item.WidgetUserId.ToString();<br>        dock.ID = string.Format("RadDock{0}", dock.UniqueName);<br>        dock.Title = title;<br>        dock.Index = item.Row;<br>        dock.Closed = !item.IsActive;<br>        dock.Collapsed = item.Collapsed;<br>        dock.Width = Unit.Pixel(width);<br>        dock.Tag = tag;<br>        dock.EnableAnimation = true;<br>                <br>        dock.Commands.Add(new DockCloseCommand());<br>        dock.Commands.Add(new DockExpandCollapseCommand());<br><br>        return dock;<br>    }<br>    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)<br>    {<br>        //Populate the event args with the state information. The RadDockLayout control<br>        // will automatically move the docks according that information.<br>        foreach (DockState state in CurrentDockStates)<br>        {<br>            e.Positions[state.UniqueName] = state.DockZoneID;<br>            e.Indices[state.UniqueName] = state.Index;<br>        }<br>    }<br>    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)<br>    {<br>        CurrentDockStates = RadDockLayout1.GetRegisteredDocksState();<br><br>        //save the layout to the database<br>        for (int i = 0; i < CurrentDockStates.Count; i++)<br>        {<br>            int index = CurrentDockStates[i].DockZoneID.Length-1;<br>            int column = Convert.ToInt32(CurrentDockStates[i].DockZoneID.Substring(index, 1));<br>            bool isActive = !CurrentDockStates[i].Closed;<br>            bool collapsed = CurrentDockStates[i].Collapsed;<br>            int widgetUserId = Convert.ToInt32(CurrentDockStates[i].UniqueName);<br>            WidgetUser.Update(widgetUserId, column, CurrentDockStates[i].Index, isActive, collapsed, connString);<br>        }<br><br>        if (Page.IsPostBack)<br>        {<br>            //LoadWidgets();<br>        }<br>    }<br><br>    private RadDock CreateRadDockFromState(DockState state)<br>    {<br>        RadDock dock = new RadDock();<br>        dock.DockMode = DockMode.Docked;<br>        dock.ID = string.Format("RadDock{0}", state.UniqueName);<br>        dock.ApplyState(state);<br>        dock.Commands.Add(new DockCloseCommand());<br>        dock.Commands.Add(new DockExpandCollapseCommand());<br><br>        return dock;<br>    }<br>}

a.collect<br>{<br>    color: #FFFFFF;<br>    display: inline-block;<br>    height: 15px;<br>    margin: 5px 3px;<br>    text-decoration: none;<br>    width: 226px;  <br>    font-weight:bold;<br>    font-size: 13px;<br>    white-space: nowrap;<br>    overflow: hidden;<br>}


Thanks,
Nagasree

Dobromir
Telerik team
 answered on 17 Jul 2013
1 answer
336 views
Hi
How can I change the color of a row depending on the value of a cell in the row. Somebody please help me out.
thanks
Allen
Princy
Top achievements
Rank 2
 answered on 17 Jul 2013
1 answer
258 views
I have a Telerik RAD Grid which i am bindng on client side. i have another button(Button 2) which when clicked will do a postback and get the values of the grid and call the database to perform some activity, but in the Button 2 Click event, values of the grid are lost and also the grid after Button 2 click has empty data. See below sample code.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test1.aspx.cs" Inherits="WebApplication4.test1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ 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>
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
        <script type="text/javascript">
 
    function test() {
                var EmployeeInfo = { "Emp_Number": "12349999" }
                var arr = [];
                arr.push(EmployeeInfo);
                grid = $find("<%=rdEmployeeInfo.ClientID %>");
 
                tableView = grid.get_masterTableView();
                tableView.set_dataSource(arr);
                tableView.dataBind();
            }
 
        </script>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
           <asp:button ID="Button1" runat="server" OnClientClick="test(); return false;" />
            <asp:button ID="Button2" runat="server" onclick="Button2_Click" />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
        <telerik:RadGrid ID="rdEmployeeInfo" runat="server" AutoGenerateColumns="false" AllowAutomaticInserts="false"
            AllowAutomaticUpdates="false" EnableAJAX="true" Width="100%" GridLines="None"
            PageSize="1" EnableViewState="true">
            <ItemStyle ForeColor="Orange" />
            <MasterTableView Width="100%" AutoGenerateColumns="false">
                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                <Columns>
                    <telerik:GridBoundColumn DataField="Emp_Number" HeaderText="Employee Number" ReadOnly="true">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
       
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Services;
using Telerik.Web.UI;
 
namespace WebApplication4
{
    public partial class test1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Emp_Number");
 
                rdEmployeeInfo.DataSource = dt;
                rdEmployeeInfo.DataBind();
            }
        }
 
      
 
        protected void Button2_Click(object sender, EventArgs e)
        {
 
        }
    }
}
Princy
Top achievements
Rank 2
 answered on 17 Jul 2013
1 answer
102 views
Hi i am using RadWindow.
I just want to open this Window two time.
1st time on a button;s onclick events.
2nd time on a other button;s Onclick Events using Scriptmanager.RegisterStartupScript() ;
at 2nd time its WindowManager is not being set.
so its not showing and my 1st button is being invisible.
Marin Bratanov
Telerik team
 answered on 17 Jul 2013
2 answers
361 views
I have a RadGrid Insert/Edit Form template in which I have a Submit/Update button. This button's submit behavior works perfectly if I do not reference any JavaScript calls in it. However, upon inserting an OnClientClick, it breaks the button. Here is the ASP

<asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Save" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' OnClientClick="return CheckWeight()" />

Here is the JavaScript

function CheckWeight() {
                var currentGoalWeightTotal = $("[id$='CurrentGoalWeightTotal']").val();
                var weightInput = $("[name$='AG_Weight']").val();
 
                if (parseInt(weightInput) + parseInt(currentGoalWeightTotal) > 100) {
                    alert("Please make sure that your goal weight total does not exceed 100.");
                    return false;
                }                   
            }

pmourfield
Top achievements
Rank 1
 answered on 17 Jul 2013
4 answers
110 views
We've implemented the RadEditor control with track changes switched on and were hoping that the following scenario would be possible:

  1. User A adds some text, which is recorded as an insert.
  2. User B edits the inserted text by adding some more inside it, which causes a nested insert.

What we've found is that actually, the second edit won't allow changes to be made to the text User A inserted, and any additional text falls outside that original insert.

Is this by design, or is there a way to get it working?


Thanks,

Matt
Matt
Top achievements
Rank 1
 answered on 17 Jul 2013
4 answers
217 views
Hello
  I have a radmenu inside a radpane and there are radpanes within splitbars on left and bottom of the menu i want the parent menu to be inside its own radpane but only the submenu should overlay i have tried styple position and z index when i apply to that to menu the parent radmenu is coming  out of the radpane i just want the submenu to come up i have included an image of the problem.

Thank you
JJ
Kate
Telerik team
 answered on 17 Jul 2013
1 answer
92 views
Hi,

I am using RadCaptcha with audio, but I get warning message in IE 'The webpage wants to run the following add-on: 'Windows Media Player' from 'Microsoft Corporation''. I get same message when I go to telerik RadCaptcha online demo. Checked on multiple computers, and in IE 8, 9, 10 get same warning. Please, help.
Marin Bratanov
Telerik team
 answered on 17 Jul 2013
1 answer
178 views
Hi,

  We are having a custom label control, which is having a Rad tool tip as it's child control. When the control is rendered in page, it is rendered as below,

<span class="aspLabelWithoutFocus" id="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents">

<div style="display: none; position: absolute;" id="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents_RadTooltip1" class="tooltipStyle">

 <input id="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents_RadTooltip1_ClientState" name="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents_RadTooltip1_ClientState" type="hidden" autocomplete="off">

</div>

<span class="aspLabelWithoutFocus" onmouseover="this.className='cssClassMouseOver'" onmouseout="this.className='aspLabelWithoutFocus'"></span>

</span>




  After this if we try to update the lable text from jquery. It is updated successfully, but if we have a post back after that, when the page is reloaded we get a javascript  error as "Two components with same id<RadToolRip's id> cannot be added" .

  This control is being rendered within update panel. Please help us in resolving this issue.
Marin Bratanov
Telerik team
 answered on 17 Jul 2013
1 answer
70 views

Hello,

i am using telerik time picker in asp.net application.

i am using this syntax to save time picker data in database

 timein.text;

but its not giving me Text Property in time picker. 

and also giving me this error

'Telerik.Web.UI.RadTimePicker' does not contain a definition for 'text' and no extension method 'text' accepting a first argument of type 'Telerik.Web.UI.RadTimePicker' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\Desktop\Server\Attendance System\Attendance\ShiftDefine.aspx.cs 116 36 Attendance

can u provide me a Syntax

Thanks



Shinu
Top achievements
Rank 2
 answered on 17 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?