Assign Model value to declarative control property

Thread is closed for posting
2 posts, 0 answers
  1. Dallas Sehlhorst
    Dallas Sehlhorst avatar
    19 posts
    Member since:
    Feb 2006

    Posted 10 May 2009 Link to this post

    Hey guys,

    I'm stuck on something that should be simple: how can I bind a Model value to a Telerik control's property.  More specificly, how do I set the SelectedDate property of a RadDatePicker?  I tried the following, but it's giving me a "server tag is not well formed error."

    <telerik:RadDatePicker ID="radInstallDate" SelectedDate='<%= Model.InstallDate %>' runat="server" Width="150px" SharedCalendarID="sharedCalendar"

    Thanks for the help!

  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 11 May 2009 Link to this post

    Hello Dallas,

    In order to bind the date picker control correctly you should use the following syntax:  SelectedDate='<%# Eval('Model.InstallDate') %>'. In case this does not work, please provide more explanations of the exact scenario and the data source or best - open a new support ticket and send us a sample, fully runnable reproduction demo along with detailed explanations of the desired result.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top