RadCalendar

15 posts, 0 answers
  1. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2010 Link to this post

    Hi,
     I am using the radcalendar in my page. if i click on the particular date on the calendar, need to open small window, i did that, in that window i have textbox , ok button in that if i enter some value in the textbox, after click ok, it should be displayed in the previous page(calendar page) on the particular date. tell me how to do this?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Dec 2010 Link to this post

    Hello Brown,

    You can pass the values from the window to the main page. Please go through the following documentation for more information on this.
    Using RadWindow as a Dialog

    In order to set the DayCell you can try the following approach.

    JavaScript:
    <script type="text/javascript">
        var DayCell;
        function OnDateClick(sender, args)
        
            DayCell = args.get_renderDay().DomElement;
        }
        function OnClientClose(sender, args)
        {
            // get the text passed from window     
            DayCell.innerText = "hi";  // set the day cell text
        }
        
    </script>


    Shinu.
  3. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 21 Dec 2010 Link to this post

    Hi,

     Thanks for your reply, Can you please explain me step by step, bez i am using this as first time.

     need to display some integer value (1 or 2 )from one page to radcalendar page. on the particualr date.
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Dec 2010 Link to this post

    Hello,


    Here I am pasting my code:

    MainPage with RadCalendar and RadWindow:
            <telerik:RadWindowManager ID="IntdRadWindowManager" DestroyOnClose="false" runat="server" AutoSize="true"  OnClientClose="OnClientClose">
                <Windows>
                    <telerik:RadWindow AutoSize="true" ID="RadWindow1" runat="server" NavigateUrl="window.aspx">
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>        
            <telerik:RadCalendar ID="RadCalendar1" runat="server">
                <ClientEvents OnDateClick="OnDateClick" />
            </telerik:RadCalendar>
     
    <script type="text/javascript">
        var DayCell;
        function OnDateClick(sender, args) {
            DayCell = args.get_renderDay().DomElement; // save the day-cell client object
            var radWin = window.radopen("", "RadWindow1"); // open window
        }
        function OnClientClose(sender, args) {
            if (args.get_argument() != null) {
                DayCell.innerText = args.get_argument();  // setting day-cell text
            }
        }  
    </script>


    And window page which:
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <input id="Button1" type="button" value="button" onclick="closeWin();" />
        </div>
        </form>
    </body>
    </html>
     
    <script type="text/javascript">
     
        function closeWin() {
            var oWnd = GetRadWindow();
            var textInput = document.getElementById("TextBox1");
            oWnd.close(textInput.value); // pass the value to main page
        }
               // get client object of current window
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        
    </script>


    Hope this helps.


    -Shinu.
  5. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 23 Dec 2010 Link to this post

    Hi Shinu,

      I tried that, but that radwindow is not stay in that main page... after click on the date is opened immediately is closed.....can you tell me what to do?
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Dec 2010 Link to this post

    Hello,


    I assume that you have either enabled "AutoPostBack" or using postback event for RadCalendar. And since the postback taking place, the window closes immediately after opening. Try disabling postback and see whether it helps.

    Check my mark-up for RadCalendar fro the same situation.
    <telerik:RadCalendar AutoPostBack="false" ID="RadCalendar1" runat="server">
        <ClientEvents OnDateClick="OnDateClick" />
    </telerik:RadCalendar>


    -Shinu.
  7. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 24 Dec 2010 Link to this post

    Hi shinu,

     Thanks for your reply. I'll try that.
  8. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 25 Dec 2010 Link to this post

    Hi Shinu, 

     Thank you so much it works, but one moew favour i need to display two more integer values in the particular date. 

    ex: If i click on the particular date, popup window is opening in that need to enter 3 integer values, with the alphabets.. like V=2 , S=1, O=0.. one by one order vertically.. Tell me how to do this.? and how to save those values in the database..from the main page. 
  9. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 26 Dec 2010 Link to this post

    Hi Shinu, 

     Thank you so much it works, but one moew favour i need to display two more integer values in the particular date. 

    ex: If i click on the particular date, popup window is opening in that need to enter 3 integer values, with the alphabets.. like V=2 , S=1, O=0.. one by one order vertically.. Tell me how to do this.? and how to save those values in the database..from the main page

  10. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 27 Dec 2010 Link to this post

    Hi Shinu, 

     Thank you so much it works, but one moew favour i need to display two more integer values in the particular date. 

    ex: If i click on the particular date, popup window is opening in that need to enter 3 integer values, with the alphabets.. like V=2 , S=1, O=0.. one by one order vertically.. Tell me how to do this.? and how to save those values in the database..from the main page

  11. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Dec 2010 Link to this post

    Hello Brown,


    You need to modify the code little bit to accomplish the functionality. It is possible to pass object with different attributes to the main page when closing window.

    In the window page, pass the object as shown below.
    window.aspx:
    function closeWin() {
        var oWnd = GetRadWindow();
        var textInput1 = document.getElementById("TextBox1");
        var textInput2 = document.getElementById("TextBox2");
        var textInput3 = document.getElementById("TextBox3");
        var value = new Object();  // Create new Object
        value.arg1 = textInput1.value;
        value.arg2 = textInput2.value;
        value.arg3 = textInput3.value;
        oWnd.close(value);  // Close window and pass the values
    }


    Now, in the main page, access the values like this.
    MainPage.aspx:
    function OnClientClose(sender, args) {
          if (args.get_argument() != null) {
              var value = args.get_argument().arg1 + "<br />" + args.get_argument().arg2 + "  <br />" + args.get_argument().arg3;
              DayCell.innerHTML = value;
          }
      }

    Hope this helps you.
    Happy new year in advance !   :)


    -Shinu.
  12. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 28 Dec 2010 Link to this post

    Hi shinu,

     It works, but need to expand the cell size to display those values vertically...... Is it possible to define cellpadding and cellspacing? Tell me how to do?

    1. Need to display those values vertically
    2. Need to expand the  calendar cell size..
  13. Nisha
    Nisha avatar
    2 posts
    Member since:
    Jan 2011

    Posted 01 Jan 2011 Link to this post

    Hi Shinu,

     In that calendar page after displaying the values on the particular date. Need to update that values. How to do that?
     
  14. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 03 Jan 2011 Link to this post

    Hi,

     I am using RadCalendar in my app. While click on the particular date opening the RadWindow. In that RadWindow i am entering three values, After closing that window those entered values are displaying on the particular date.

    Now in that main page RadCalendar Page : I have three textboxes...In that after closing that RadWindow. need to display the displayed values on the date....

    ex: on the date 3 : has V=1, S=1, O=1 and date 7: has V=2 , S=1, O=2.

     Need to display those values and accumulate in to textboxes in the main pages
    like:
      Vacation : 3
      Sick :2
     Other:3

    Tell me how to do?
  15. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 12 Jan 2011 Link to this post

    Hi,
     
     In my radcalendar click on the particular date opening RadWindow.. in that i am entering values...and displaying those values on the particular cell.


    I have a small question if I switch to next month will those entered values are remain on the date? Is it possible...Could you please let me know...
Back to Top