RadCalendar :Save the Daycell value in database

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

    Posted 14 Jan 2011 Link to this post

    Hi,
     I am using RadCalendar , in that click on the particular date opening the radwindow. in that window i am entering values those values are displayed on the date (daycell).. I need to display those values in the database .. Could you please tell me how to do this?
  2. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 18 Jan 2011 Link to this post

    Hi Brown,

    You could try by wiring the SelectionChanged event of RadCalendar and in its event handler to make a call to the database and update it. This should happen manually since RadCalendar is not a databound control.

    Additionally, note that in order to have Selection Change fired, you need to set AutoPostBack="true" for the RadCalendar control.

    Best wishes,
    Tsvetina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 18 Jan 2011 Link to this post

    Hi,

     You are saying while selecting the date... that's fine.. but i have some values in my daycell object. need to save in to the database. could you please tell me how to do that?
  4. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 18 Jan 2011 Link to this post

    Hi Brown,

    How exactly are the values added to the cell? Please, post the code relevant to this scenario, so we can get a better idea of how you operate with the calendar control.

    Kind regards,
    Tsvetina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 18 Jan 2011 Link to this post

    Hi,

     This is the way i am going to place the value on the cell.... 


    ( In my calendar on click on the date opening radwindow in that radwindow entering three values those values are displayed on the date in this manner)

    This is for the main page :

     

    if (args.get_argument() != null)

     

    {

     

    var value = args.get_argument().arg1+ BR + args.get_argument().arg2+ BR + args.get_argument().arg3;

     

     

    DayCell.innerText = value;

    // setting day-cell text

     

     

     




    And the Radwindow page:



     

    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 =

    "V=" + textInput1.value;

     

    value.arg2 =

    "S=" + textInput2.value;

     

    value.arg3 =

    "O=" + textInput3.value;

     

     

     

    if(textInput1.value != 0)

     

    {

    value.arg1 =

    "V=" + textInput1.value;

     

    }

     

    else

     

     

     

     

    {

    value.arg1 =

    "V=" + 0;

     

    }

     

     

    if(textInput2.value != 0)

     

    {

    value.arg2 =

    "S=" + textInput2.value;

     

    }

     

    else

     

     

     

     

    {

    value.arg2 =

    "S=" + 0;

     

    }

     

     

    if(textInput3.value != 0)

     

    {

    value.arg3 =

    "O=" + textInput3.value;

     

    }

     

    else

     

     

     

     

    {

    value.arg3 =

    "O=" + 0;

     

    }

     

    oWnd.close(value);

     

    }

     

  6. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 23 Jan 2011 Link to this post

    Hi Brown,

     
    Since working with the inner html of cells could be tricky on the server-side, it might be easier for you if you are saving the displayed values in hidden fields on the page and access them directly on the server. As for saving them in the database, as RadCalendar is not a data-bound control, there is no built-in functionality to save values in database, so you will need to do this manually. 

    Regards,
    Tsvetina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top