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 ::

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

    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
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 30 Jun 2015 Link to this post

    Hi,

    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.

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