no calender popup in content of masterpage

2 posts, 0 answers
  1. Gerald
    Gerald avatar
    2 posts
    Member since:
    Apr 2008

    Posted 24 Apr 2008 Link to this post

    Hello

    i have a very big problem that the DatePicker doesn´t work in an Site witch i load as asp:Content in an MasterPage. In the MasterPage a have radTreeview for navigation with one form.

    Can you help me!!!!!!!



    My Digram02.aspx File

    <%

    @ Page Language="vb" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="~/Diagramm02.aspx.vb" Inherits="_Default"%>

    <%

    @ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>

    <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <%

    @ Register Assembly="Telerik.Charting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763" Namespace="Telerik.Charting" TagPrefix="telerik" %>

     

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDisAnContent" runat="Server">

    <asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager>

    <script type="text/javascript">

    <!--

    function OnPopupOpening(sender, args)

    {

    // TraceEvent("OnPopupOpening fired by " + sender.get_id() + "<br />");

    var firstDatePicker = $find("<%= RadDatePicker1.ClientID %>");

    // process the event only for the second datepicker

    if (sender.get_id() == firstDatePicker.get_id())

    return;

    // process the event only if the second datepicker is empty and the first is not

    if (sender.isEmpty() == false || firstDatePicker.isEmpty() == true)

    return;

    var dateToNavigate = GetDateToNavigate();

    var secondDatePicker = $find("<%= RadDatePicker2.ClientID %>");

    }

    function OnPopupClosing(sender, args)

    {

    // TraceEvent("OnPopupClosing fired by " + sender.get_id() + "<br />");

    // process the event only for the second datepicker

    if (sender.get_id() == "<%= RadDatePicker1.ClientID %>")

    return;

    // process the event only if the first datepicker is not empty

    var firstDatePicker = $find("<%= RadDatePicker1.ClientID %>");

    if (firstDatePicker.isEmpty() == true)

    return;

    var dateArr = sender.get_calendar().get_selectedDates();

    if(dateArr[0])

    {

    var date = new Date(dateArr[0][0], dateArr[0][1] - 1, dateArr[0][2]);

    var dateToCompare = firstDatePicker.get_selectedDate();

    if(date < dateToCompare)

    {

    alert(

    "Bitte, wählen Sie einen späteren Endpunkt aus!");

    args.set_cancel(

    true);

    }

    }

    }

    function GetDateToNavigate()

    {

    var firstDatePicker = $find("<%= RadDatePicker1.ClientID %>");

    var dateToNavigate = firstDatePicker.get_selectedDate();

    return dateToNavigate;

    }

    function OnDateSelected(sender, e)

    {

    if (e.get_newDate() != null)

    {

    // TraceEvent("OnDateSelected: " + e.get_newDate().toDateString() + " selected in " + sender.get_id() + "<br />");

    }

    else

    {

    // TraceEvent("OnDateSelected: Date cleared in " + sender.get_id() + "<br />");

    }

    }

    var output;

    /* function TraceEvent(message)

    {

    if (!output)

    {

    output = document.getElementById("eventLog");

    }

    if (output)

    {

    var now = new Date();

    var str = "[" + now.toLocaleTimeString() + "]&nbsp;"

    + message;

    output.innerHTML = output.innerHTML + (output.innerHTML ? "\n" : "") + str;

    output.scrollTop = 10000000;

    }

    }

    */

    -->

    </script>

    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/chart.mdb" SelectCommand="SELECT Datum, Wert FROM Messwerte WHERE (Id = 1)" DataSourceMode="DataReader"></asp:AccessDataSource>

    <telerik:RadSplitter ID="RadSplitter1" runat="server" ResizeMode="EndPane" LiveResize="false" Height="500" Width="830">

    <telerik:RadSplitBar ID="RadSplitbar3" runat="server" CollapseMode="Forward" />

    <telerik:RadPane ID="navigationPane" runat="server" Scrolling="none">

    <telerik:RadChart ID="RadChart1" runat="server" CssClass="RadChart" DataSourceID="AccessDataSource1" DefaultType="Line" CreateImageMap="False">

    <Series>

    <telerik:ChartSeries DataYColumn="Wert" Name="Wert" Type="Line">

    <Appearance>

    <FillStyle MainColor="0, 0, 0">

    </FillStyle>

    <LabelAppearance Visible="False">

    </LabelAppearance>

    </Appearance>

    </telerik:ChartSeries>

    </Series>

    </telerik:RadChart>

    </telerik:RadPane>

    <telerik:RadSplitBar ID="RadSplitbar1" runat="server" CollapseMode="Forward" />

    <telerik:RadPane ID="RadPane2" runat="server" Scrolling="none" Width="300">

    <div class="TitleNews"><b>Einstellungen</b><br /></div>

    <telerik:RadSplitter ID="RadSplitter2" runat="server" LiveResize="false" Orientation="Horizontal" CssClass="Telerik">

    <telerik:RadPane ID="topPane" runat="server" Height="150" Scrolling="both">

    <table>

    <tr>

    <td><asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Medium">Startdatum:</asp:Label>

    </td>

    <td><telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="German (Germany)" Width="150px" SelectedDate="2008-01-01" >

    <ClientEvents OnPopupOpening="OnPopupOpening" OnPopupClosing="OnPopupClosing" OnDateSelected="OnDateSelected">

    </ClientEvents>

    <DateInput runat="server" InvalidStyleDuration="100" SelectedDate="2008-01-01">

    </DateInput>

    </telerik:RadDatePicker>

    </td>

    </tr>

    <tr>

    <td><asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Medium">Enddatum:</asp:Label>

    </td>

    <td><telerik:RadDatePicker ID="RadDatePicker2" runat="server" Culture="German (Germany)" Width="150px" SelectedDate="2008-01-02" >

    <ClientEvents OnPopupOpening="OnPopupOpening" OnPopupClosing="OnPopupClosing" OnDateSelected="OnDateSelected">

    </ClientEvents>

    <DateInput runat="server" InvalidStyleDuration="100" SelectedDate="2008-01-02">

    </DateInput>

    </telerik:RadDatePicker>

    </td>

    </tr>

    <tr>

    <td colspan="2"><label for="dropDownCategory">

    <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Medium">Energiezähler:</asp:Label>

    </label>

    </td>

    </tr>

    <tr>

    <td colspan="2"><asp:DropDownList ID="dropDownCategory" runat="server" AutoPostBack="True" OnSelectedIndexChanged="dropDownCategory_SelectedIndexChanged" Width="225">

    </asp:DropDownList>

    </td>

    </tr>

    <tr>

    <td colspan="2" align="center"><asp:Button ID="Button1" runat="server" Text="Start" />

    </td>

    </tr>

    </table>

    </telerik:RadPane>

    <telerik:RadSplitBar ID="RadSplitbar2" runat="server" CollapseMode="Forward" />

    <telerik:RadPane ID="contentPane" runat="server" Scrolling="Y">

    <!-- Grid für Daten der Zähler -->

    <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/Konfiguration.mdb" SelectCommand="SELECT Zaehlernummer, Einbaudatum, Typenbezeichnung, Anlagenkennzeichnung, Bezugsflaeche, Wandlerkonstante, Ausbaudatum FROM Zaehler WHERE (Zaehlernummer = 'BERT1/1/22/684801/2/81')"></asp:AccessDataSource>

    <asp:DataList ID="DataList1" runat="server" DataSourceID="AccessDataSource2">

    <ItemTemplate>

    Zaehlernummer:

    <asp:Label ID="ZaehlernummerLabel" runat="server" Text='<%# Eval("Zaehlernummer") %>'></asp:Label><br />

    Einbaudatum:

    <asp:Label ID="EinbaudatumLabel" runat="server" Text='<%# Eval("Einbaudatum") %>'></asp:Label><br />

    Typenbezeichnung:

    <asp:Label ID="TypenbezeichnungLabel" runat="server" Text='<%# Eval("Typenbezeichnung") %>'></asp:Label><br />

    Anlagenkennzeichnung:

    <asp:Label ID="AnlagenkennzeichnungLabel" runat="server" Text='<%# Eval("Anlagenkennzeichnung") %>'></asp:Label><br />

    Bezugsflaeche:

    <asp:Label ID="BezugsflaecheLabel" runat="server" Text='<%# Eval("Bezugsflaeche") %>'></asp:Label><br />

    Wandlerkonstante:

    <asp:Label ID="WandlerkonstanteLabel" runat="server" Text='<%# Eval("Wandlerkonstante") %>'></asp:Label><br />

    Ausbaudatum:

    <asp:Label ID="AusbaudatumLabel" runat="server" Text='<%# Eval("Ausbaudatum") %>'></asp:Label><br />

    <br />

    </ItemTemplate>

    </asp:DataList></telerik:RadPane>

    </telerik:RadSplitter>

    </telerik:RadPane>

    </telerik:RadSplitter>

    </asp:Content>

    -------------------------------------------------------------------------------------------
    My Diagramm02.aspx.vb File
    -------------------------------------------------------------------------------------------

    Imports

    System.Data.OleDb

    Partial

    Public Class _Default

    Inherits System.Web.UI.Page

    Protected dbCon As OleDbConnection

    Protected dbCon2 As OleDbConnection

     

    Private Sub InitDropDownCategory(ByVal dbCon As OleDbConnection)

    Dim adapter As New OleDbDataAdapter("SELECT * FROM Category", dbCon)

    Dim ds As New DataSet()

    adapter.Fill(ds)

    dropDownCategory.Items.Clear()

    Dim dbRow As DataRow

    For Each dbRow In ds.Tables(0).Rows

    If Not (dbRow("name") Is Nothing) Then

    dropDownCategory.Items.Add(

    CStr(dbRow("name")))

    End If

    Next dbRow

    End Sub 'InitDropDownCategory

     

    Protected Sub dropDownCategory_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

    ' dbCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/Chart/Examples/DataBinding/Data/chart.mdb"))

    ' dbCon.Open()

    ' UpdateRadChart1(dbCon)

    ' dbCon.Close()

    ' dbCon2 = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/Chart/Examples/DataBinding/Data/Konfiguration.mdb"))

    ' dbCon2.Open()

    'UpdateDataList1(dbCon2)

    ' dbCon2.Close()

     

     

    End Sub 'dropDownCategory_SelectedIndexChanged

    Protected Sub dropDownYears_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

    dbCon =

    New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/chart.mdb"))

    dbCon.Open()

    UpdateRadChart1(dbCon)

    dbCon.Close()

    End Sub 'dropDownYears_SelectedIndexChanged

     

    Private Sub InitRadChart1()

    RadChart1.DataSourceID = AccessDataSource1.ID

    RadChart1.ChartTitle.TextBlock.Text = dropDownCategory.SelectedItem.Text

    End Sub

    Private Sub UpdateDataList1(ByVal dbCon2 As OleDbConnection)

    Dim sqlString As String

    ' Dim DropDownAuswahl As String = dropDownCategory.SelectedIndex + 1

    Dim DropDownAuswahl As String = dropDownCategory.SelectedValue

    'DropDownAuswahl = "'BERT1/1/22/684801/2/81'"

    sqlString =

    "SELECT Zaehlernummer, Einbaudatum, Typenbezeichnung, Anlagenkennzeichnung, Bezugsflaeche, Wandlerkonstante, Ausbaudatum FROM Zaehler WHERE (Zaehlernummer = " + DropDownAuswahl + ");"

    AccessDataSource2.SelectCommand = sqlString

     

     

    End Sub

     

    Private Sub UpdateRadChart1(ByVal dbCon As OleDbConnection)

    Dim sqlString As String

    Dim DropDownAuswahl As String = dropDownCategory.SelectedIndex + 1

    Dim StartDate As String = "01.01.2008"

    Dim EndDate As String = "31.10.2008"

     

    StartDate = RadDatePicker1.SelectedDate

    EndDate = RadDatePicker2.SelectedDate

    sqlString =

    "SELECT [Id], [Datum], [Wert] FROM Messwerte WHERE ((Id=" + DropDownAuswahl + ") AND (Datum > '" + StartDate + "') AND (Datum < '" + EndDate + "'));"

    RadChart1.Series.Clear()

    RadChart1.DataGroupColumn =

    "Id"

    'RadChart1.AutoLayout = "True"

    'RadChart1.ClientSettings.ScrollMode = Web.UI.ChartClientScrollMode.XOnly

    'RadChart1.ClientSettings.EnableZoom = "False"

    'RadChart1.ClientSettings.XScale = "10"

     

    ' Update the Data source control's select command.

    AccessDataSource1.SelectCommand = sqlString

    ' Set additional properties and settings for the chart.

    RadChart1.ChartTitle.TextBlock.Text = dropDownCategory.SelectedItem.Text

    'RadChart1.PlotArea.XAxis.DataLabelsColumn = "Datum"

     

     

     

    End Sub 'UpdateRadChart1

     

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    If Not Page.IsPostBack Then

    dbCon =

    New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/chart.mdb"))

    dbCon.Open()

    InitDropDownCategory(dbCon)

    InitRadChart1()

    dbCon.Close()

    End If

    RadChart1.Skin =

    "LightBlue"

    RadChart1.Width =

    "500"

    RadChart1.Height =

    "500"

    RadChart1.PlotArea.XAxis.Visible = Telerik.Charting.Styles.ChartAxisVisibility.False

    RadChart1.Legend.Visible =

    False

     

     

    End Sub 'Page_Load

    Protected Sub RadChart1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadChart1.DataBound

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    dbCon =

    New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/chart.mdb"))

    dbCon.Open()

    UpdateRadChart1(dbCon)

    dbCon.Close()

    dbCon2 =

    New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/Konfiguration.mdb"))

    dbCon2.Open()

    'UpdateDataList1(dbCon2)

    dbCon2.Close()

    End Sub

    End

    Class 'DefaultVB

    -------------------------------------------------------------------------------------------

    My MasterPage.master
    -------------------------------------------------------------------------------------------


    <%

    @ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

    <%

    @ Register Assembly="RadTreeView.Net2" Namespace="Telerik.WebControls" TagPrefix="radT" %>

    <!

    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>Energiemanagment - EMSY</title>

    <link href="css/emsy.css" rel="stylesheet" type="text/css" />

    </

    head>

    <

    body>

     

    <form id="form1" runat="server">

    <div>

    <table style="width:100%">

    <tr>

    <td colspan="3" align=center style="height: 89px">

    <div id="header">Energiemanagement - EMSY<div id="slogan">

    </div>

    </td>

    </tr>

    <tr>

    <td style="width: 231px" valign=top>

    <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

    <script language="javascript" type="text/javascript">

    function SaveSelectedNodes(node) {

    var i;

    var selectedNodes = "";

    for(i=0; i<node.TreeView.AllNodes.length; i++)

    {

    if(node.TreeView.AllNodes[i].Expanded)

    selectedNodes += node.TreeView.AllNodes[i].Value +

    "*";

    }

    Set_Cookie(

    "test",selectedNodes);

    }

    function Set_Cookie( name, value, expires, path, domain, secure )

    {

    // set time, it's in milliseconds

    var today = new Date();

    today.setTime( today.getTime() );

    /*

    if the expires variable is set, make the correct

    expires time, the current script below will set

    it for x number of days, to make it for hours,

    delete * 24, for minutes, delete * 60 * 24

    */

    if ( expires )

    {

    expires = expires * 1000 * 60 * 60 * 24;

    }

    var expires_date = new Date( today.getTime() + (expires) );

    document.cookie = name +

    "=" +escape( value ) +

    ( ( expires ) ?

    ";expires=" + expires_date.toGMTString() : "" ) +

    ( ( path ) ?

    ";path=" + path : "" ) +

    ( ( domain ) ?

    ";domain=" + domain : "" ) +

    ( ( secure ) ?

    ";secure" : "" );

    }

    </script>

    <div id="DisAn_PageCell">

    <!-- Left Tree Menu-->

    <div id="DisAn_TreeContainer">

    <radT:RadTreeView

    ID="RadTree1"

    Skin = "Square/3DClassic"

    ShowLineImages="False"

    ExpandDelay="0"

    AfterClientToggle="SaveSelectedNodes"

    runat="server">

    </radT:RadTreeView>

    </div>

    </div>

    <!-- End Page Cell-->

    </asp:contentplaceholder>

    </td>

    <td colspan="2" valign="top">

    <asp:ContentPlaceHolder ID="ContentPlaceHolderDisAnContent" runat="server">

    </asp:ContentPlaceHolder>

    </td>

    </tr>

    </table>

    <br />

    &nbsp;

    </div>

    </form>

    </

    body>

    </

    html>

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Apr 2008 Link to this post

    Hi Gerald,

    I tried to prepare a project using the provided code, but was not able to run it, due to missing resources. Will it be convenient to open a regular support ticket and send us a sample runnable application, which replicates the issue? We will test it locally and advise you further.

    Kind regards,
    Maria Ilieva
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top