radtextbox format date

3 posts, 0 answers
  1. Judith
    Judith avatar
    14 posts
    Member since:
    Aug 2007

    Posted 10 May 2010 Link to this post

    I would like to format a date in radtextbox to exclude the time.. I have the following code



    telerik:RadTextBox ID="txtEntryDate"



    EmptyMessage="" ToolTip="Entry date"



    Text='<%#Bind("EntryDate") %>'






    readonly = "true"



    runat="server" Width="100px"/>

    This does not work and it is still displayed with the time. I do not want to use a date picker because this date should never be changed.
     Thank you.


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

    Posted 11 May 2010 Link to this post

    Hi Judith,

    Try the following approach in order to format the Date displayed in RadTextBox.


    <telerik:RadTextBox ID="txtEntryDate" EmptyMessage="" ToolTip="Entry date" Text='<%# String.Format("{0:MM/dd/yyyy}",Eval("EntryDate"))   %>'  
        ReadOnly="true" runat="server" Width="100px" /> 

    Also you can use the RadDateInput control as an alternative.


    <telerik:RadDateInput ID="RadDateInput1" ReadOnly="true" SelectedDate='<%#Eval("EntryDate") %>' DateFormat="MM/dd/yyyy"  


  3. Eon
    Eon avatar
    15 posts
    Member since:
    Apr 2015

    Posted 08 Dec 2015 in reply to Shinu Link to this post

    Thanks Shinu's, this have help me with the radtextbox, your first solution worked.
Back to Top