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?
5 Answers, 1 is accepted
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

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?
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

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);
}
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.
Tsvetina
the Telerik team