Get String of DatePicker

5 posts, 0 answers
  1. Nagiza
    Nagiza avatar
    7 posts
    Member since:
    Sep 2015

    Posted 24 Sep 2015 Link to this post

    Hello

    I am new in the community of Telerik

    I want to get the string to select the date

    example of test:

    in frm.aspx

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"></telerik:RadDatePicker>​

    in frm.aspx.vb

     Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'here code!!
            Dim x As String
            x = RadDatePicker1.xxxxxx
            MsgBox(x)
        End Sub Dim x As String
          

    how Get String of DatePicker??

    sorry my english

     

     

  2. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 24 Sep 2015 Link to this post

    Hello Nagiza,

    SelectedDate property returns an object of type DateTime? (nullable DateTime).

    Protected Sub Button1_Click(sender As Object, e As EventArgs)
        Dim dateAsString As String = RadDatePicker1.SelectedDate.ToString()
            ....
    End Sub

    More detailed:
    Protected Sub Button1_Click(sender As Object, e As EventArgs)
        Dim nullableDate As System.Nullable(Of DateTime) = RadDatePicker1.SelectedDate
        Dim [date] As DateTime = nullableDate.Value
        Dim dateAsString As String = [date].ToString()
    End Sub

    Let me know if you need more information.

    Regards,
    Daniel
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nagiza
    Nagiza avatar
    7 posts
    Member since:
    Sep 2015

    Posted 25 Sep 2015 in reply to Daniel Link to this post

    Hello Daniel
    thanks by help me,

    in both codes:

    get this "09/10/2015 12:00:00 a.m." but I just want the date
    10/09/2015

     Regards

     

  5. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 25 Sep 2015 Link to this post

    Hello Nagiza,

    I would recommend that you examine the following link:
    Standard Date and Time Format Strings

    DateTime type is native to .NET Framework and the best way to find information about it is to look inside MSDN.

    Regards,
    Daniel
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Nagiza
    Nagiza avatar
    7 posts
    Member since:
    Sep 2015

    Posted 25 Sep 2015 in reply to Daniel Link to this post

    ok

    thanks

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017