Appointment Template DataBound

8 posts, 0 answers
  1. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 25 Feb 2008 Link to this post

    I want to have a customized appointment template based on the data. I can hide/display some controls based on the data. Now, in existing telerik control model, AppointmentCreated() event allows .Container Property but there is no data there. AppointmentDataBound() has data set in its  properties but there is no Container there.

    Not only that, if I want to get the DataItem - that is currently being bound and FindControl() during DataBound() event - it would be perfect implementation of this control. IF you know how to do this pl. let me know.

    2) How do I customize the time ("8:00 AM") displayed in time column? Can I print 800 like in outlook for this?

    Thanks,
    Piyush Bhatt  
  2. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 26 Feb 2008 Link to this post

    Anyhow, I finally achieved this through CustomAttributes. I did not find this referenced much in demos or documentation, but found it in some messages here.

    2nd item still remains open - can I control how to display time instead of the default time it is displaying?

    -Piyush
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 27 Feb 2008 Link to this post

    Hello Piyush,

    Please, set HoursPanelTimeFormat="h00" for RadScheduler. Let us know how it goes.


    Regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 27 Feb 2008 Link to this post

    Sure h00 displays time as 800, 900 etc. But what I wanted to do is to display time like in outlook like where the hour number is in big fonts and 00 is very small. And then display AM/PM at 1200 but not all the time. do you think that is possible? or have my own function get called before displaying the time?


  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 27 Feb 2008 Link to this post

    Hi Piyush,

    This is not possible out-of-the-box. If you find a workaround, we will be glad if you share it in the forum.

    Regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Jun
    Jun avatar
    47 posts
    Member since:
    Sep 2006

    Posted 21 Oct 2009 Link to this post

    <AppointmentTemplate>                              
        <%# Convert.ToInt32(Eval("DayBetween")) < 0 ? "<img src='../images/smallRed.gif' />" : Convert.ToInt32(Eval("DayBetween")) < 11 ? "<img src='../images/smallYellow.gif' />" : "<img src='../images/smallGreen.gif' />"%> 
        <%# Eval("TicklerCode")%> 
        <%# Eval("Subject") %> 
    </AppointmentTemplate> 

    I have the above template and all the fields are defined at scheduler's customattributenames. The scheduler displays the template populated with data. I can insert a new appointment if the day is not filled yet. BUT if a day is already filled with at least one appointment and when I tried to click to insert a new appointment, it is giving me an error that the fields inside the eval expressions are no longer valid, It says,

    Databinding methods such as eval, xpath and bind can only be used in the context of a databound control. WHY?

  8. Jun
    Jun avatar
    47 posts
    Member since:
    Sep 2006

    Posted 21 Oct 2009 Link to this post

    <AppointmentTemplate>                              
        <%# Convert.ToInt32(Eval("DayBetween")) < 0 ? "<img src='../images/smallRed.gif' />" : Convert.ToInt32(Eval("DayBetween")) < 11 ? "<img src='../images/smallYellow.gif' />" : "<img src='../images/smallGreen.gif' />"%> 
        <%# Eval("TicklerCode")%> 
        <%# Eval("Subject") %> 
    </AppointmentTemplate> 

    I have the above template and all the fields are defined at scheduler's customattributenames. The scheduler displays the template populated with data. I can insert a new appointment if the day is not filled yet. BUT if a day is already filled with at least one appointment and when I tried to click to insert a new appointment, it is giving me an error that the fields inside the eval expressions are no longer valid, It says,

    Databinding methods such as eval, xpath and bind can only be used in the context of a databound control. WHY?

  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 26 Oct 2009 Link to this post

    Hi Jun,

    We tested your custom AppointmentTemplate, but we could not replicate the problem locally. Please, open a support ticket and send us a simple working demo for further testing.


    Regards,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017