Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
92 views
Hi, I created a simple Dock to pass messages back but when the close icon in the dock is clicked IE8 triggers compatibility mode and reloads the page. After that I can refresh the page and everything works. It is only on the first page load the issue presents itself.

Here is my code, first the Master Page:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Master.cs" Inherits="Web.App_Templates.Site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title><Page Title</title>
    <telerik:RadStyleSheetManager id="TelerikStyleSheetManager" runat="server" />
    <asp:ContentPlaceHolder ID="HeadContentPlaceHolder" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="MainForm" runat="server">
  
        <telerik:RadScriptManager ID="TelerikScriptManager" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
  
        <asp:ContentPlaceHolder ID="ScriptContentPlaceHolder" runat="server">
        </asp:ContentPlaceHolder>
  
        <telerik:RadAjaxManager ID="TelerikAjaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="TelerikDock"></telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
  
        <telerik:RadSkinManager ID="TelerikSkinManager" Runat="server" Skin="Telerik">
        </telerik:RadSkinManager>
  
        <telerik:RadWindowManager ID="TelerikWindowManager" runat="server">
            <Windows>
                <telerik:RadWindow ID="TelerikWindow" runat="server">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
  
        <telerik:RadFormDecorator ID="TelerikFormDecorator" Runat="server" Skin="Telerik" DecoratedControls="All" />
  
        <asp:UpdatePanel 
            ID="MainUpdatePanel" 
            runat="server">
            <ContentTemplate>
  
                <telerik:RadDockLayout 
                    runat="server" 
                    ID="TelerikDockLayout" 
                    Visible="false">
                    <telerik:RadDockZone ID="TelerikDockZone" runat="server" Orientation="Horizontal" MinHeight="20px" BorderWidth="0">
                    <telerik:RadDock ID="TelerikDock" runat="server" Title="Informational Message" Width="100%" EnableAnimation="true" EnableRoundedCorners="true" Resizable="true">
                        <ContentTemplate>
  
                            <asp:Literal 
                                ID="Feedback" 
                                runat="server" 
                                Text=" " />
  
                        </ContentTemplate>
                    </telerik:RadDock>
                    </telerik:RadDockZone>
                </telerik:RadDockLayout>
  
                <asp:ContentPlaceHolder 
                    ID="MainContentPlaceHolder" 
                    runat="server">
                </asp:ContentPlaceHolder>
  
            </ContentTemplate>
        </asp:UpdatePanel>
  
    </form>
</body>
</html>

Master page code behind (simplified):

namespace Web.App_Templates
{
    using System;
    using System.Web.UI;
  
    public partial class Site : MasterPage
    {
        public void ShowFeedback(string feedBackText, bool useAlert)
        {
            if (feedBackText == string.Empty)
            {
                this.Feedback.Text = feedBackText;
                this.TelerikDock.Title = feedBackText;
                this.TelerikDockLayout.Visible = false;
            }
            else
            {
                if (useAlert)
                {
                    var radAlertScript =
                        string.Format(
                            "function f(){{radalert('{0}', 330, 210);Sys.Application.remove_load(f);}};Sys.Application.add_load(f);",
                            feedBackText);
  
                    ScriptManager.RegisterStartupScript(
                        Page, 
                        Page.GetType(), 
                        "Feedback"
                        radAlertScript, 
                        true);
                }
                else
                {
                    this.Feedback.Text = feedBackText;
  
                    this.TelerikDockLayout.Visible = true;
                }
            }
        }
  
        public void ShowFeedback(string feedbackTitle, string feedBackText, bool useAlert)
        {
            if (feedBackText == string.Empty)
            {
                this.Feedback.Text = feedBackText;
                this.TelerikDock.Title = feedBackText;
                this.TelerikDockLayout.Visible = false;
            }
            else
            {
                if (useAlert)
                {
                    var radAlertScript =
                        string.Format(
                            "function f(){{radalert('{0}', 330, 210, '{1}');Sys.Application.remove_load(f);}};Sys.Application.add_load(f);",
                            feedBackText, 
                            feedbackTitle);
  
                    ScriptManager.RegisterStartupScript(
                        Page, 
                        Page.GetType(), 
                        "Feedback"
                        radAlertScript, 
                        true);
                }
                else
                {
                    this.Feedback.Text = feedBackText;
  
                    this.TelerikDock.Title = feedbackTitle;
  
                    this.TelerikDockLayout.Visible = true;
                }
            }
        }
    }
}

(bear with me :) Content Page:

<%@ Page Title="Home" Language="C#" MasterPageFile="~/App_Templates/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ MasterType VirtualPath="~/App_Templates/Site.Master" %>
  
<asp:Content ID="HeadContent" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">
</asp:Content>
  
<asp:Content ID="ScriptContent" ContentPlaceHolderID="ScriptContentPlaceHolder" runat="server">
</asp:Content>
  
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
  
  
  
</asp:Content>

...and finally, the content page code behind (again simplified):

namespace Web
{
    using System;
  
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.ShowFeedback("Test Title", "Test normal feedback message.", false);
  
            // this.Master.ShowFeedback( "Test Title", "Test pop-up feedback message.",true);
       }
    }
}

Everything works fine, there are no errors (client or server) but when I click close, that is when the compatibility view triggers and the page reloads (displaying the messages again).

Can anyone tell me what the issue is? I'll admit my experience of using Dock is minimal, so hopefully it's something stupid simple :)

Thanks in advance,
Richard

Pero
Telerik team
 answered on 15 Mar 2011
2 answers
113 views
Hi,
I am using a RadGrid that has another RadGrid as item template. Finally Grid contains RadTextBox as ItemTemplate.

I want to export the top grid with all its children data. But no data is exported and an error "Unable to cast object of type 'Telerik.Web.UI.GridTFoot' to type 'Telerik.Web.UI.GridTableView'." occurs. 


<

 

 

telerik:radgrid id="gvCategory" runat="server" headerstyle-wrap="false" allowpaging="false"  

allowsorting="false" autogeneratecolumns="false" gridlines="None" showheader="false" onexcelmlexportstylescreated="gvCategory_ExcelMLExportStylesCreated" onexcelmlexportrowcreated="gvCategory_ExcelMLExportRowCreated">  

<MasterTableView DataKeyNames="CatId,CatName">
<Columns>

<telerik:GridTemplateColumn ItemStyle-HorizontalAlign ="Center"> 

<ItemTemplate >
<telerik:RadGrid ID="gvQuestions" HeaderStyle-HorizontalAlign="Left" OnItemDataBound ="gvQuestions_ItemDataBound" GridLines="None" runat="server" AllowPaging="false" AllowSorting="false" AutoGenerateColumns ="false" Width="100%" BorderStyle ="None">

<MasterTableView DataKeyNames ="QuestionId,OptionId,ScoringLogicTypeId,QuestionName">

<Columns>

<telerik:GridBoundColumn UniqueName="Attributes" DataField="QuestionName" Visible ="True" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle" ItemStyle-Width ="75%" ItemStyle-BorderStyle

="None">

 

</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="Options" ItemStyle-HorizontalAlign ="Left" ItemStyle-Font-Size="8" ItemStyle-Width="10%" ItemStyle-BorderStyle ="None">
<ItemTemplate >

<asp:Panel ID="pnOptions" runat="server" Width ="100%">
<asp:Label ID="lblOptions" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Option") %> '> </asp:Label >

</asp:Panel >

</ItemTemplate >

</telerik:GridTemplateColumn >
<telerik:GridTemplateColumn UniqueName="Matrix" ItemStyle-HorizontalAlign ="Left" ItemStyle-Width="10%" ItemStyle-BorderStyle ="None">
<ItemTemplate >
<asp:Panel ID="pnMatrix" runat="server" Width ="100%">  

<telerik:RadTextBox Enabled="false" Font-Bold="true" ID="txtXMin" runat ="server" CssClass="textBox" Visible="True" Width="30px" Text='<%# DataBinder.Eval(Container.DataItem, "XMin") %>' />

&nbsp;&nbsp;  

<telerik:RadTextBox Enabled="false" Font-Bold="true" ID="txtXMax" runat ="server" CssClass="textBox" Visible="True" Width="30px" Text='<%# DataBinder.Eval(Container.DataItem, "XMax") %>' />&nbsp;&nbsp;

</asp:Panel >
</ItemTemplate  

</telerik:GridTemplateColumn  

</Columns >

</MasterTableView >
</telerik:radgrid >

 

 

 

 

Anil
Top achievements
Rank 1
 answered on 15 Mar 2011
3 answers
170 views
Hi,

I am upgrading an application from Classic Telerik controls to the latest ASP.NET AJAX ones.  I have replaced the following line of code

AjaxPanel.AjaxRequest -=

 

new RadAjaxPanel.AjaxPanelRequestEventHandler(ContentPaneControl_AjaxRequest);

 


with this one:

AjaxPanel.AjaxRequest -=

 

new RadAjaxControl.AjaxRequestDelegate(ContentPaneControl_AjaxRequest);

 


because the former would no longer compile.

It's crazy, but I can't even find where I got the idea for the second line.  Anyway, the problem is that it works with some of my controls but not with others.  For some controls it goes into ContentPaneControl_AjaxRequest, for others - it doesn't.  The code is all in one script.  They all go to that same script.

Any ideas?

Thanks,
Olga
Veli
Telerik team
 answered on 15 Mar 2011
1 answer
201 views
Hi,

Is it possible to create RadAjaxManager in codebehind?

I have a master page and I am creating a RadAjaxManager in the OnInit method of the master page. Later when I try to ajaxify a control within an aspx page using the AddAjaxSettings method I created in master page I get Object reference not set to an instance of an object.

Master Page
protected override void OnInit(EventArgs e)
{                       
HtmlForm form = (HtmlForm)this.Controls[3];
form.Controls.Add(new RadAjaxManager());
}
 
public void AddAjaxSetting(Control ajaxified, Control updated, RadAjaxLoadingPanel loading)
{
HtmlForm form = (HtmlForm)this.Controls[3];
RadAjaxManager ajax = form.Controls[1] as RadAjaxManager;
ajax.AjaxSettings.AddAjaxSetting(ajaxified, updated, loading);
}


ASPX page
protected void Page_Load(object sender, EventArgs e)
{           
     (this.Master as PortalMaster).AddAjaxSetting(button, panel, loading);
}

Edit: I get the null reference error in ajax.AjaxSettings.AddAjaxSetting(ajaxified, updated, loading); line. All variables are pointing to correct objects (ajax, button, panel, loading).

Thank you...
Eric
Top achievements
Rank 1
 answered on 15 Mar 2011
2 answers
102 views
Hi There,

I have a radgrid that is placed on the usercontrol. Grid is under RadAjaxManagerProxy.
I am not able to use the inbuilt Export to excel property of the grid

Although I have searched for the same and found that its because of asynchronous post back,
I have also written client side event(OnRequestStart) for the radajaxmanager on pageload event of the usercontrol, but not able to use the export inbuilt functionality.
Kindly suggest how to achieve this.

 RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);

           if (manager != null)
            {
                manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager_AjaxRequest);
                manager.ClientEvents.OnRequestStart = "onAJAXResponseStart";
                manager.ClientEvents.OnResponseEnd = "onAJAXResponseEnd";
            }


     

        function onAJAXResponseStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {

                args.set_enableAjax(false);
            }
            else {
                args.set_enableAjax(true);
            }

        }


Thanks
Saurabh
Saurabh
Top achievements
Rank 1
 answered on 15 Mar 2011
1 answer
124 views
Hello

I've looked at a lot of posts regarding formatting problems for appointments but am still having an issue...I want to increase the font size of appointments in day view to 14pt for printing purposes and have done so in the following way:

<telerik:RadScheduler ID="RadScheduler1" runat="server" DataKeyField="ID" DataStartField="appStartTime"
                DataEndField="appEndTime" DataSubjectField="appSubject" DataSourceID="SqlDataSource2"
                Skin="Sitefinity" CustomAttributeNames="resourceLabelColour" >
</telerik:RadScheduler>


Private Sub RadScheduler1_AppointmentCreated...

        e.Appointment.BackColor = System.Drawing.Color.FromName(e.Appointment.Attributes("resourceLabelColour"))

        Dim i As System.Web.UI.WebControls.FontUnit
        i = 14
        e.Appointment.Font.Size = i

End Sub


In Chrome everything looks fine, however in IE 8 the bottoms of the letters get cut off (please see the two attached screenshots).  I have tried changing various CSS properties but am not able to get it looking right in IE...

Thanks for any suggestions

Brian

Peter
Telerik team
 answered on 15 Mar 2011
3 answers
92 views

I have developed my site in following environment.

.netframework 2.0
ajax 2.0 where there is no issue
 I am running my site in following environment.
.net framework 4.0 wihout converting it into 4.0  
Getting following types of error.
Microsoft JScript runtime error: 'RadMenu' is undefined
Microsoft JScript runtime error: 'RadTabStrip' is undefined
Microsoft JScript runtime error: 'RadControlsNamespace' is undefined
Microsoft JScript runtime error: 'RadGridNamespace' is undefined
Microsoft JScript runtime error: 'RadTabStrip' is undefined

what should be done to solve this issue?

Iana Tsolova
Telerik team
 answered on 15 Mar 2011
1 answer
74 views
I'm interested in shifting the right click column context menu to a left click.  I've gotten this to work by binding to the OnColumnClick event and showing the menu in that way (though i also have to put in a timer and disable closing the menu for a short time - otherwise it shows and immediately hides itself).  However, if the user clicks on the header text itself (rather than just the column background), the grid still wants to sort itself.  Disabling sort fixes that problem, but then it also removes the sort functions from the context menu.

My context menu already has a number of custom elements in it, and i could certainly just add my own custom entries there.  But i figured i would stop in here and see if there's an out of the box way to accomplish this goal.  Can you turn off click to sort, but maintain the menu entries?

-RP
Veli
Telerik team
 answered on 15 Mar 2011
6 answers
174 views
Hi!

Can someone show me an example how to accomplish the following in RadScheduler?

The user selects the desired time slots with the mouse pointer and then right click to bring up a TimeSlotContextMenu designed something like this:

<TimeSlotContextMenus>
    <telerik:RadSchedulerContextMenu ID="SchedulerTimeSlotContextMenu" runat="server">
    <Items>
        <telerik:RadMenuItem Text="Peter" />
        <telerik:RadMenuItem Text="Adam" />
        <telerik:RadMenuItem Text="Niclas" />
        <telerik:RadMenuItem Text="Jones" />
    </Items>
    </telerik:RadSchedulerContextMenu>
</TimeSlotContextMenus>

Then when the user choose one of the menu items a booking should be done without poping up a booking form.

Is it possible? If so, how do I do it?

I'm using C# and the Rad v2010.3.1317.40.

Sincerely, Thomas




Peter
Telerik team
 answered on 15 Mar 2011
1 answer
125 views
Hi,

Can we have RadMenu in our custome sharepoint 2010 Master page. Please suggest How we can achieve this?

Thanks
Ali
Kalina
Telerik team
 answered on 15 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?