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"
    </telerik:RadDatePicker> 

    Thanks for the help!

    -Dallas
  2. Svetlina Anati
    Admin
    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,
    Svetlina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top