assign value to RadDatePicker from database

2 posts, 1 answers
  1. Hadoop
    Hadoop avatar
    8 posts
    Member since:
    Jun 2015

    Posted 25 Jun 2015 Link to this post

    I've to populate the RadDatePicker from database. From database, i am accessing the data value as string. I am having problem to set that value to RadDatePicker.

    Form sample ::

            <td>Date of Birth : </td>
                <telerik:RadDatePicker ID="dtp_DOB" runat="server"></telerik:RadDatePicker>

    in code behing page ::

    DataTable dt = GetPersonalDetails(p_id);
    if (dt != null && dt.Rows.Count > 0)
        DataRow dr = dt.Rows[0];       
        string DOB_ = dr["DateOfBirth"].ToString();
        dtp_DOB.SelectedDate = ????

    How to show the date retrieved from database to RadDatePicker? Please help.

  2. Answer
    Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 30 Jun 2015 Link to this post


    As the data-binding documentation article states:
    When embedding the RadDatePicker control inside a data-bound control, use a data-binding expression to bind the value of the input control to the data source of the parent control. In addition to calling Eval and Bind methods to perform data binding in a data-binding expression,you can call any publicly scoped code within the <%# and %> delimiters to execute that code and return a value during page processing.
    Revise the provided help topic and see if it helps.

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