Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
406 views
I'm having a problem with the RadDatePicker when it is used inside a dynamically loaded user control. Also, the dynamically loaded user control is displayed inside a RadPageView.

The problem is this: I set the initial value for the RadDatePicker in server-side code when the user control is first created. The initial value displays correctly when the page is displayed. However, once a postback occurs the value is "lost" (i.e. the RadDatePicker is blank). If you type in a date or select a date using the calendar then the value is persisted across postbacks. It's only the initial value, set on the server side when the user control is created, that is not persisted across postbacks.

Here is some sample code. First, the user control:

WebUserControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">  
</telerik:RadDatePicker> 
 

WebUserControl.ascx.cs
public partial class WebUserControl : System.Web.UI.UserControl  
{  
    public void DisplayInformation()  
    {  
        RadDatePicker1.SelectedDate = DateTime.Now.Date;  
    }  
} 

Default.aspx
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register src="WebUserControl.ascx" tagname="WebUserControl" 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>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated">  
        </telerik:RadMultiPage> 
        <asp:Button ID="Button2" runat="server" Text="Create Page View" OnClick="Button2_Click" /> 
        <asp:Button ID="Button1" runat="server" Text="PostBack" /> 
    </div> 
    </form> 
</body> 
</html> 
 

Default.aspx.cs
public partial class _Default : System.Web.UI.Page   
{  
    bool DoDisplay = false;  
 
    protected void Button2_Click(object sender, EventArgs e)  
    {  
        // Display initial values the first time the user  
        // control is created.  
        DoDisplay = true;  
 
        RadPageView pv = new RadPageView();  
        pv.ID = "RadPageView1";  
        RadMultiPage1.PageViews.Add(pv);  
    }  
 
    protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)  
    {  
        WebUserControl wuc = Page.LoadControl("WebUserControl.ascx") as WebUserControl;  
        wuc.ID = "WebUserControl1";  
        e.PageView.Selected = true;  
 
        // Only display initial values the first time the  
        // user control is created. On subsequent postbacks  
        // we want the value from the viewstate.  
        if (DoDisplay)  
            wuc.DisplayInformation();  
 
        e.PageView.Controls.Add(wuc);  
    }  
 
} 
Scott R
Top achievements
Rank 1
 answered on 22 Jul 2008
2 answers
99 views
Hi,

I'm trying to use a radprompt windows, everything work fine but when i clik OK in the radprompt Windows, another radprompt open, if i click ten times, ten radprompt open....

The issue is the same on your online demo.

I understand that this is due to the fact that the focus is on my backgroud window, but how to intercept the Enter Key Hit and redirect it to the radprompt window?
My users will doesn't want to use their mouse for this kind of validations !

I already try the "mybutton.blur()" method or to set the focus to another element of my "backgroud" page without success.

Thank for your help....
Haddadi
Top achievements
Rank 1
 answered on 22 Jul 2008
1 answer
138 views
Hi,

I have a MOSS publishing site.

It has a Style library installed in it.

Publishing site is using few telerik controls.

The 'Default' theme for telerik controls is stored inside "App_Themes" folder on the web application directory.

I want to use "Style Library" on MOSS site instead of "App_Themes" folder on web application.

Can any how i can modify telerik control theme so that it can be used after adding theme in "Style Library"?

Thanks
Sudhir
Dimo
Telerik team
 answered on 22 Jul 2008
3 answers
186 views
In my application, I'm using the onbeforeunload event to check for unsaved changes by the user.  This works great for regular forms.  I tried the same approach with pages used as RadWindows, and it kind of works.  If I change a value on the radwindow and click the "x" to close it without saving, the RadWindow closes and then the prompt to save shows up.  Obviously this is too late since the RadWindow is now gone.  I thought about trying to use the OnClientClose event on the RadWindow, but the documentation states that it is called after the window is closed.  Is there a way to to run some javascript when the "x" on the RadWindow is clicked so that I have a chance to stop it and ask the user to save changes?

Doug
Georgi Tunev
Telerik team
 answered on 22 Jul 2008
1 answer
88 views
RadRotator control is missing in Q1 2008 version. Is there any equivalent control to this particular control?
Kevin Babcock
Top achievements
Rank 1
 answered on 22 Jul 2008
1 answer
457 views
For Loadingpane on page load i used the link given below.
http://www.telerik.com/help/aspnet-ajax/ajxshowloadingpaneloninitialpageload.html

But it load page first then it gives the loading panel.
I am using radtabstrip control and on each  radtab i added grid control.
Heare i want to show the loading panel when i click on tab.

I Follow above link  but it first load the tab and its control  and then it gives the loading panel.

How can it be possible to show the loading panel on  tab click event before the grid load.

Thanking you.
Kevin Babcock
Top achievements
Rank 1
 answered on 22 Jul 2008
5 answers
171 views

I'm having a problem doing this (as in no code errors but still get postbacks).

I populate a RadTreeView programatically and when a node is clicked I want Ajax to kick in and change the ContentURL of a RadPane.

Can anyone see what I might be doing wrong in the code below (in green),

protected void PopulateNavSites(RadTreeNode LASitesNode)     
        {     
            LASitesNode.Nodes.Clear();     
    
            DataSet dsSites = Master.Services.Site.getAllSitesByLaName(Master.User.Username, LASitesNode.Value);     
            if (dsSites.Tables[0] != null)     
            {     
                foreach (DataRow Row in dsSites.Tables[0].Rows)     
                {     
                    RadTreeNode Node = new RadTreeNode();     
                    Node.Text = Row["siteName"].ToString();     
                    Node.Value = Row["siteID"].ToString();     
                    Node.Attributes.Add("nodeType", "Site");     
                    PopulateNavSiteTools(Node);     
                    LASitesNode.Nodes.Add(Node);     
                    radAjaxManagerProxy.AjaxSettings.AddAjaxSetting(Node, radPaneContent, Master.radLoadingPanel);     
                }     
            }     
        } 

 

 

Maria Ilieva
Telerik team
 answered on 22 Jul 2008
2 answers
196 views
The first time my page posts and I use 

C.PlotArea.YAxis.Appearance.CustomFormat =  YAxisFormat

where YAxisFormat = "##.00'%";

my Yaxis does not show percent sign with the major/minor ticks.  If I refresh the graph the percent sign shows up.

Any thougths?

Cheers

chuck

Charles Craig
Top achievements
Rank 1
 answered on 22 Jul 2008
3 answers
109 views
Is there a way to generate a report with parameters that displays all of the data on the first iteration (generation) and then allows the user to select parameters to slim down the report if they wish to?

Thanks
Jim
Steve
Telerik team
 answered on 22 Jul 2008
2 answers
153 views
Hi

I am using a radSplitter inside a UserControl
and I have a HTML button within this control which is used to CLOSE a Sliding pane

However the Javascript needs to find the RadSlidingZone inside the UserControl
Is there any way to do this? (I'm not a Javascript expert!)

Normally I would put the Java function after the BODY page element as follows
BUT this produces an compilation error because the Splitter is inside a userControl

<body>
<script type="text/javascript">
function ClosePane_SignIn()
{
 var slidingZone = $find("<%= RadSlidingZone1.ClientID %>");
 slidingZone.collapsePane("RadSlidingPaneSignIn");
}

Any help appreciated...

Regards

Martin
Martin
Top achievements
Rank 1
 answered on 22 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?