Hi, I'm trying to use the scheduler to pull data from SQL and display. The problem is the grid comes up blank everytime...I don't understand why the data isn't binding or displaying or whatever...any help is GREATLY appreciated.
Here is the first part:
using System;
using System.Data;
public partial class SchedulerMonth : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DayPilotScheduler1.StartDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DayPilotScheduler1.Days = DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month);
Label1.Text = DayPilotScheduler1.StartDate.ToString("MMMM yyyy");
DayPilotScheduler1.DataSource = sql;
DataBind();
}
}
This is right from the demo minus the DayPilotScheduler1.DataSource = sql; which I've added as a datasource...simple select * from table Here is the data:
ID Name Start End resource
1 first event 2009-02-03 00:00:00.000 2009-02-03 00:00:00.000 Bob
2 second event 2009-02-03 00:00:00.000 2009-02-03 00:00:00.000 Joe
Here is the aspx page...didn't change from original much
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="SchedulerMonth.aspx.cs" Inherits="SchedulerMonth" Title="DayPilot Lite Demo | Monthly Scheduler" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="Label1" runat="server" Text="Label" Font-Bold="true" Font-Size="16pt"></asp:Label><br />
<DayPilot:DayPilotScheduler ID="DayPilotScheduler1" runat="server"
HeaderFontSize="8pt" HeaderHeight="20"
DataStartField="Start"
DataEndField="End"
DataTextField="Name"
DataValueField="ID"
DataResourceField="resource"
EventHeight="20"
EventFontSize="11px"
CellDuration="1440"
>
<Resources>
<DayPilot:Resource Name="Room A" Value="A" />
<DayPilot:Resource Name="Room B" Value="B" />
<DayPilot:Resource Name="Room C" Value="C" />
<DayPilot:Resource Name="Room D" Value="D" />
<DayPilot:Resource Name="Room E" Value="E" />
<DayPilot:Resource Name="Room F" Value="F" />
<DayPilot:Resource Name="Room G" Value="G" />
<DayPilot:Resource Name="Room H" Value="H" />
<DayPilot:Resource Name="Room I" Value="I" />
<DayPilot:Resource Name="Room J" Value="J" />
<DayPilot:Resource Name="Room K" Value="K" />
<DayPilot:Resource Name="Room L" Value="L" />
<DayPilot:Resource Name="Room M" Value="M" />
</Resources>
</DayPilot:DayPilotScheduler>
<asp:SqlDataSource ID="sql" runat="server"
ConnectionString="<%$ ConnectionStrings:db_OCEANS15ConnectionString %>"
SelectCommand="SELECT * FROM [tbl_Proj_Cal2]"></asp:SqlDataSource>
</asp:Content>