RadDatePicker

5 posts, 0 answers
  1. nisha
    nisha avatar
    19 posts
    Member since:
    May 2010

    Posted 08 Jul 2010 Link to this post

    Hi,

    I'm using DatePicker and I want achieve few modifications in the date format. I want the date format like dd-mm-yyyy but in datepicker i'm getting dd/mm/yyyy. I have given the DateRangeSeperator = "-" but its not working. Also I want to remove to time stamp after date. Any help would be appreciated.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Jul 2010 Link to this post

    Hi Nisha,


    You can achieve this by setting properties: DateFormat and DisplayDateFormat

    ASPX:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
        <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
        </DateInput>
    </telerik:RadDatePicker>


    -Shinu.
  3. nisha
    nisha avatar
    19 posts
    Member since:
    May 2010

    Posted 09 Jul 2010 Link to this post

    Hi Shinu,

    Thanks for the reply, I'm getting the required date format. But in code behind when I retrieve the value of that textbox, it should be in the same format. For eg, I have given
    string date = RadDatePicker1.SelectedDate.ToString();
    output for date is "19/01/2009 12:00:00 AM"
    I want it as "19-01-2009"
    How do I achieve this?

     

  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jul 2010 Link to this post

    Hello Nisha,


    You can do it from code behind. Have a look at the following code.

    C#:
        string date1 = RadDatePicker1.SelectedDate.Value.ToString("dd-MM-yyyy");


    -Shinu.
  5. nisha
    nisha avatar
    19 posts
    Member since:
    May 2010

    Posted 10 Jul 2010 Link to this post

    Thanks a lot :)
Back to Top