Date Picker & Time Picker - URGENT Solve Immediately

2 posts, 0 answers
  1. Abdul Kadar
    Abdul Kadar avatar
    35 posts
    Member since:
    Oct 2008

    Posted 15 Oct 2008 Link to this post

    Hi
    In my application,I used Date Picker & time picker seperately.
    I use the below code to avoid null values

    If

     

      RadDatePicker1.IsEmpty Then
    RadDatePicker1.SelectedDate = "01/01/2000"
    End If

    My problem is how to clear the data in raddatepicker1 when clicking new button
    Also when I retrieve the data from the database, if the date in the database is "01/01/2000"
    ,I need the raddatepicker1 control data is empty.

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Oct 2008 Link to this post

    Hello Abdul,

    Try out the following code to clear the DatePicker on a button click.
    protected void NewButton_Click(object sender, EventArgs e) 
        { 
            // Code to access the datepicker from its container control 
            RadDatePicker.Clear(); 
        } 

    Also to clear the button when the DbSelectedDate is a particular date, ypu can use the following code.
     //code to access datepicker from its container control 
     if (RadDatePicker.DbSelectedDate.ToString() == "01/01/2000")  
        {  
           RadDatePicker.Clear();                  
        }  

    Thanks
    Princy.
Back to Top