problem in loading and saving multiple selection Dates

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

    Posted 16 May 2008 Link to this post

    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.

  2. Steve
    Admin
    Steve avatar
    10940 posts

    Posted 17 May 2008 Link to this post

    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
Back to Top