Oct 05, 2011, 10:25 AM
[CLOSED] Couple of issues detected on CalendarPanel on codebehind (V 1.2)
Hello again,
I have detected a couple of problems creating a calendarpanel on codebehind.
1- I have no equivalent to the monthview StartDay property on the weekview, So I cannot force the begining of the week in the weekview to use Monday instead of the default Sunday.
2- Property DDResizeEventText does not exist in WeekView nor in DayView, so I cannot localize the text.
SAmple code (Default.aspx)
I have detected a couple of problems creating a calendarpanel on codebehind.
1- I have no equivalent to the monthview StartDay property on the weekview, So I cannot force the begining of the week in the weekview to use Monday instead of the default Sunday.
2- Property DDResizeEventText does not exist in WeekView nor in DayView, so I cannot localize the text.
SAmple code (Default.aspx)
<%@ Page
Language = "C#"
AutoEventWireup = "true"
Inherits = "testcalendar.Default"
ValidateRequest = "false"
EnableSessionState = "true"
%>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Calendar Test</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
</form>
</body>
</html>
Default.aspx.csusing System;
using System.Web.UI;
using Ext.Net;
namespace testcalendar {
/// <summary>
/// Description of MainForm.
/// </summary>
public class Default : Page {
private void Page_Load(object sender, EventArgs e) {
//Panel
Panel pnl=new Panel();
pnl.ID="MainPanel";
pnl.Width=System.Web.UI.WebControls.Unit.Pixel(800);
pnl.Height=System.Web.UI.WebControls.Unit.Pixel(400);
pnl.Border=true;
//fitlayout for the panel
FitLayout fly=new FitLayout();
fly.ID="panelfitlayout";
//Calendar
CalendarPanel cp=new CalendarPanel();
//cp.Region=Region.Center;
cp.ID="CalendarPanel1";
cp.MonthText="Mes";
cp.WeekText="Semana";
cp.DayText="Día";
cp.TodayText="Hoy";
cp.ActiveIndex=1;
//creating group store
GroupStore grsto=new GroupStore();
grsto.ID="GroupStore1";
//creating first group
Group grp=new Group();
grp.CalendarId=1;
grp.Title="group 1";
grsto.Groups.Add(grp);
//Month view parameters
cp.MonthView=new MonthView();
cp.MonthView.ShowHeader=true;
cp.MonthView.ShowWeekLinks=true;
cp.MonthView.ShowWeekNumbers=true;
cp.MonthView.StartDay=1;
cp.MonthView.TodayText="Hoy";
cp.MonthView.DDMoveEventText="Mover actividad a {0}";
cp.MonthView.DDCreateEventText="Crear actividad en {0}";
cp.MonthView.DDResizeEventText="Actualizar actividad a {0}";
//week view parameters
cp.WeekView=new WeekView();
cp.WeekView.TodayText="Hoy";
cp.WeekView.DDMoveEventText="Mover actividad a {0}";
cp.WeekView.DDCreateEventText="Crear actividad en {0}";
//ERROR WeekView does not contain these properties!!
//cp.WeekView.DDResizeEventText="Actualizar actividad a {0}";
//cp.WeekView.StartDay=1;
//Day View parameters
cp.DayView=new DayView();
cp.DayView.TodayText="Hoy";
cp.DayView.DDMoveEventText="Mover actividad a {0}";
cp.DayView.DDCreateEventText="Crear actividad en {0}";
//ERROR DayView does not contain this property!!
//cp.DayView.DDResizeEventText="Actualizar actividad a {0}";
//Empty eventstore
EventStore mainStore=new EventStore();
//add one event
Event myEvent = new Event();
myEvent.Title = "titulo";
myEvent.StartDate = DateTime.Now.AddDays(-1);
myEvent.EndDate = DateTime.Now.AddDays(-1).AddHours(1);
myEvent.IsNew=true;
myEvent.EventId=11;
myEvent.CalendarId=1;
mainStore.Events.Add(myEvent);
mainStore.DataBind();
cp.EventStore=mainStore;
//add calendar to fitlayout
fly.Items.Add(cp);
//add fitlayout to panel
pnl.ContentControls.Add(fly);
//add panel to form
this.Form.Controls.Add(pnl);
}
}
}
Last edited by Daniil; Oct 10, 2011 at 12:10 PM.
Reason: [CLOSED]