Hi
This is another error that I am getting:
Microsoft Jscript error. rows.0.cells is null or not and objehct
I get the above mentioned error when I transfere the database connection from the ASP.NET connetions in the code behind. I used the example http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx.
The demo works fine as it is but when I do the changes to bind the RadScheduler from code behind, I get errors.
This is my code behind, please assist:
protected void Page_Load(object sender, EventArgs e)
{
// XmlDocument xDoc = new XmlDocument();
// xDoc = DataTableToXmlDocument(getAppointment);
//r order = xDoc.ChildNodes[2];
// XmlDataSource1.Data = DataTableToXmlDocument(getAppointment).InnerXml;
// xDoc = DataTableToXmlDocument(getAppointment).InnerXml;
getmyAppointments();
getmyRooms();
// XmlDataSource1.DataBind();
}
public void getmyRooms()
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = WebConfigurationManager.ConnectionStrings["Localstring"].ConnectionString;
SqlCommand myCommand = new SqlCommand();
myCommand.CommandText = "SELECT [RoomID], [Name] FROM [Grouping_Rooms]";
myCommand.Connection = myConnection;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet productsDataSet = new DataSet();
myAdapter.Fill(productsDataSet);
ResourceType RT = new ResourceType();
RT.DataSource = productsDataSet.Tables[0];
RT.KeyField = productsDataSet.Tables[0].Columns[0].ToString();
RT.ForeignKeyField = productsDataSet.Tables[0].Columns[0].ToString();
RT.TextField= productsDataSet.Tables[0].Columns[1].ToString();
RadScheduler1.ResourceTypes.Add(RT);
}
public void getmyAppointments()
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = WebConfigurationManager.ConnectionStrings["Localstring"].ConnectionString;
SqlCommand Command = new SqlCommand();
Command.CommandText = "SELECT [ID], [Description], [Start], [End], [RoomID], [RecurrenceRule], [RecurrenceParentID] FROM [Grouping_Events]";
Command.Connection = myConnection;
SqlDataAdapter Adapter = new SqlDataAdapter(Command);
DataSet AppDataSet = new DataSet();
Adapter.Fill(AppDataSet);
// RadScheduler1.
RadScheduler1.DataKeyField = AppDataSet.Tables[0].Columns[0].ToString();
RadScheduler1.DataSubjectField = AppDataSet.Tables[0].Columns[1].ToString();
RadScheduler1.DataStartField = AppDataSet.Tables[0].Columns[2].ToString();
RadScheduler1.DataEndField = AppDataSet.Tables[0].Columns[3].ToString();
RadScheduler1.DataSource = AppDataSet.Tables[0];
RadScheduler1.DataBind();
}
This is another error that I am getting:
Microsoft Jscript error. rows.0.cells is null or not and objehct
I get the above mentioned error when I transfere the database connection from the ASP.NET connetions in the code behind. I used the example http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx.
The demo works fine as it is but when I do the changes to bind the RadScheduler from code behind, I get errors.
This is my code behind, please assist:
protected void Page_Load(object sender, EventArgs e)
{
// XmlDocument xDoc = new XmlDocument();
// xDoc = DataTableToXmlDocument(getAppointment);
//r order = xDoc.ChildNodes[2];
// XmlDataSource1.Data = DataTableToXmlDocument(getAppointment).InnerXml;
// xDoc = DataTableToXmlDocument(getAppointment).InnerXml;
getmyAppointments();
getmyRooms();
// XmlDataSource1.DataBind();
}
public void getmyRooms()
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = WebConfigurationManager.ConnectionStrings["Localstring"].ConnectionString;
SqlCommand myCommand = new SqlCommand();
myCommand.CommandText = "SELECT [RoomID], [Name] FROM [Grouping_Rooms]";
myCommand.Connection = myConnection;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet productsDataSet = new DataSet();
myAdapter.Fill(productsDataSet);
ResourceType RT = new ResourceType();
RT.DataSource = productsDataSet.Tables[0];
RT.KeyField = productsDataSet.Tables[0].Columns[0].ToString();
RT.ForeignKeyField = productsDataSet.Tables[0].Columns[0].ToString();
RT.TextField= productsDataSet.Tables[0].Columns[1].ToString();
RadScheduler1.ResourceTypes.Add(RT);
}
public void getmyAppointments()
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = WebConfigurationManager.ConnectionStrings["Localstring"].ConnectionString;
SqlCommand Command = new SqlCommand();
Command.CommandText = "SELECT [ID], [Description], [Start], [End], [RoomID], [RecurrenceRule], [RecurrenceParentID] FROM [Grouping_Events]";
Command.Connection = myConnection;
SqlDataAdapter Adapter = new SqlDataAdapter(Command);
DataSet AppDataSet = new DataSet();
Adapter.Fill(AppDataSet);
// RadScheduler1.
RadScheduler1.DataKeyField = AppDataSet.Tables[0].Columns[0].ToString();
RadScheduler1.DataSubjectField = AppDataSet.Tables[0].Columns[1].ToString();
RadScheduler1.DataStartField = AppDataSet.Tables[0].Columns[2].ToString();
RadScheduler1.DataEndField = AppDataSet.Tables[0].Columns[3].ToString();
RadScheduler1.DataSource = AppDataSet.Tables[0];
RadScheduler1.DataBind();
}