This is a migrated thread and some comments may be shown as answers.

problem in loading and saving multiple selection Dates

1 Answer 79 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Rama
Top achievements
Rank 1
Rama asked on 16 May 2008, 07:37 PM
Hi,

I am trying to save the multiple selected Dates in sqlServer Database and retrieving from Database while page loading.

List

<DateTime> selectedDateList = new List<DateTime>();

/*Retrieving from RadCalender Selected Dates and saving to Database*/

for
(int i = 0; i <RadCalendar1.SelectedDates.Count; i++)

{

selectedDateList[i].Date= RadCalendar1.SelectedDates[i].Date; // Getting error at this statement saying "Index was out of range. Must be non-negative and less than the size of the collection."

Saveto DataBase(selectedDateList);

}


/*Retrieving Data from Sql and loading into RadCalender*/

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

{

RadCalendar1.SelectedDates[i].Date =

Convert.ToDateTime(ds.Tables[0].Rows[i]["START_DATE"]);  // Getting error at this statement saying "Index was out of range. Must be non-negative and less than the size of the collection."

}

Can anybody check and send me the solution please ASAP.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 May 2008, 01:09 PM
Hi Rama,

Find attached a sample project showing RadCalendar and binding dates from SQL and let us know how it goes.

Regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Calendar
Asked by
Rama
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or