Focused Date Column

2 posts, 0 answers
  1. Matt
    Matt avatar
    4 posts
    Member since:
    Jul 2008

    Posted 28 Jul 2008 Link to this post

    I need to create a multiview calendar w/ 3 columns.  However, this is for an application that looks backwards in time.  I'm trying to get the current month to show in the 3rd column (right side).  I've tried setting the focused date to today, then setting the FocusedDateColumn property to 2 then to 3 as I wasn't sure if the property was zero-based.  Neither works.

    I've tried setting the property at design time which causes a designer error and the control won't render.  I've also tried to set it at runtime which throws the "Index was outside the bounds of the array" error.

    Is there a sample that I've overlooked on how to correctly use this property, or am I mistaken on the purpose of the FocusedDateColumn property?

    Thanks in advance,

    Matt
  2. Plamen Peshev
    Admin
    Plamen Peshev avatar
    885 posts

    Posted 31 Jul 2008 Link to this post

    Hi Matt,


    The FocusedDateColumn and FocusedDateRow properties are obsolete and will be removed from RadCalendar for the next version of the product. Please check whether your RadCalendar declaration does not contain these properties and if yes remove them. You can use SelectedDate instead of FocusedDateColumn. Here is an example:

    <%@ Page Language="C#" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
        <script runat="server"
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (IsPostBack) 
                RadCalendar1RadCalendar1.FocusedDate = RadCalendar1.SelectedDate.AddMonths(-2); 
        }     
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            <div> 
                 
                <telerik:RadCalendar  
                    MultiViewColumns="3"  
                    EnableMultiSelect="false"  
                    AutoPostBack="true"  
                    ID="RadCalendar1"  
                    runat="server" > 
                </telerik:RadCalendar> 
            </div> 
        </form> 
    </body> 
    </html> 
     



    Greetings,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top