function
OnClientAppointmentContextMenu(sender, args) {
alert(
"Appointment context menu: " + args.get_appointment().get_subject());
}
function OnClientAppointmentContextMenu(sender, args) {
alert(
"Appointment context menu: " + args.get_appointment().get_statusid());
}
its shows error..ForeignKeyField at run time Then Appointment Not Showing in Scheduler Records Come In Our Dataset ant its bind Successfull bit Does Not Show In Scheduler. Why Please Help Me.
My Source Code :
ds = dl.FillDataSet(
CommandType.StoredProcedure, "uspGetAppointments", HashIn);
if (ds.Tables[0].Rows.Count > 0)
{
RadScheduler1.SelectedDate = CalApp.SelectedDate;
RadScheduler1.DayStartTime =
TimeSpan.Parse(ds.Tables[0].Rows[0].ItemArray[0].ToString());
RadScheduler1.DayEndTime =
TimeSpan.Parse(ds.Tables[0].Rows[0].ItemArray[1].ToString());
RadScheduler1.MinutesPerRow =
int.Parse(ds.Tables[0].Rows[0].ItemArray[2].ToString());
RadScheduler1.TimeLabelRowSpan = 60 /
int.Parse(ds.Tables[0].Rows[0].ItemArray[2].ToString());
RadScheduler1.DataKeyField =
"AppointmentId";
RadScheduler1.DataStartField =
"FromTime";
RadScheduler1.DataEndField =
"ToTime";
RadScheduler1.DataSubjectField =
"Subject";
RadScheduler1.GroupBy =
"Resource";
RadScheduler1.DataDescriptionField =
"StatusColor";
RadScheduler1.ResourceTypes.Clear();
ResourceType rt = new ResourceType("Resource");
rt.DataSource = ds.Tables[2];
rt.KeyField =
"ResourceId";
if (ddlFacility.SelectedValue == "0")
{
rt.ForeignKeyField =
"FacilityId";
}
else
{
rt.ForeignKeyField =
"DoctorId";
}
rt.TextField =
"ResourceName";
RadScheduler1.ResourceTypes.Add(rt);
RadScheduler1.DataSource = ds.Tables[1];
RadScheduler1.DataBind();
Thanks
Chandan
| function lboxItemClicked(sender, args) { |
| var i = args.get_item(); |
| i.set_checked(!i.get_checked()); |
| args.set_cancel(true); |
| } |
| // Add event handler |
| grid.GridExporting += new OnGridExportingEventHandler(grid_GridExporting); |
| // The handler: showing only the PDF branch |
| static void grid_GridExporting(object source, GridExportingArgs e) |
| { |
| RadGrid grid = (RadGrid)source; |
| switch (e.ExportType) |
| { |
| case ExportType.Pdf: |
| ApplyStylesToPDFExport(grid.MasterTableView); |
| break; |
| } |
| } |
Which calls:
| // The routine, trimmed to simple example... the code executes when I step thru it... |
| static void ApplyStylesToPDFExport(GridTableView gtable) |
| { |
| foreach (GridColumn col in gtable.Columns) |
| { |
| col.HeaderStyle.BackColor = System.Drawing.Color.Silver; |
| col.HeaderStyle.ForeColor = System.Drawing.Color.Red; |
| } |
| } |
So what am I doing wrong OR how can I do the equivalent. The PDF export is done by the built-in export buttons... All of the code is in a Utility class because it will be used on dozens of pages...
| DataSet dS = new DataSet(); |
| DataTable dT = listItems.GetDataTable(); |
| dS.Merge(dT); |
| dT.Columns.Add("FromSql"); |
| SqlDataAdapter myCnd = new SqlDataAdapter(); |
| myCnd = new SqlDataAdapter("select tID, tDATE, tTITLE, dDATE from myTable", strConn); |
| DataSet dS1 = new DataSet(); |
| myCnd.Fill(dS1); |
| foreach (DataRow row in dt.Rows) |
| { |
| DataRow custdRow = dT.custdRow(); |
| custdRow["ID"] = row["tID"].ToString(); |
| custdRow["Title"] = row["tTITLE"].ToString(); |
| custdRow["strtDate"] = row["tDATE"].ToString(); |
| custdRow["endDate"] = row["dDATE"].ToString(); |
| custdRow["FromSql"] = "Retrieve"; |
| dT.Rows.Add(custdRow); |
| } |
| dS1.Merge(dT); |
| dS.Merge(dS1,true); |
| //RadScheduler1.DataSource = dT ; |
| RadScheduler1.DataSource = dS; |
| RadScheduler1.DataKeyField = "ID"; |
| RadScheduler1.DataStartField = "strtDate"; |
| RadScheduler1.DataEndField = "endDate"; |
| RadScheduler1.DataSubjectField = "Title"; |
| RadScheduler1.DataBind(); |