<
telerik:RadGrid
runat
=
"server"
ID
=
"rgdDataPreview"
Skin
=
"Office2007"
AutoGenerateColumns
=
"true"
AllowPaging
=
"true"
PageSize
=
"5"
OnNeedDataSource
=
"rgdDataPreview_NeedDataSource"
OnPageIndexChanged
=
"rgdDataPreview_PageIndexChanged"
OnPageSizeChanged
=
"rgdDataPreview_PageSizeChanged"
AllowSorting
=
"false"
Width
=
"1200px"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
/>
<
Resizing
AllowColumnResize
=
"True"
AllowRowResize
=
"false"
ResizeGridOnColumnResize
=
"false"
ClipCellContentOnResize
=
"true"
EnableRealTimeResize
=
"false"
AllowResizeToFit
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
telerik:RadImageEditor
ID
=
"annotationImageEditor"
runat
=
"server"
OnImageLoading
=
"annotationImageEditor_ImageLoading"
OnDialogLoading
=
"annotationImageEditor_DialogLoading"
Width
=
"500px"
Height
=
"500px"
>
<
Tools
>
<
telerik:ImageEditorToolGroup
>
<
telerik:ImageEditorTool
CommandName
=
"Reset"
ToolTip
=
"Clear"
/>
<
telerik:ImageEditorToolSeparator
/>
<
telerik:ImageEditorTool
CommandName
=
"AddText"
ToolTip
=
"Add text"
/>
<
telerik:ImageEditorTool
CommandName
=
"StampArrowDialog"
ImageUrl
=
"~/img/rightArrowIcon.png"
/>
<
telerik:ImageEditorTool
CommandName
=
"StampStatusDialog"
mageUrl
=
"~/img/stampicon.png"
/>
<
telerik:ImageEditorTool
CommandName
=
"StampPatient"
ImageUrl
=
"~/img/patient.png"
/>
</
telerik:ImageEditorToolGroup
>
</
Tools
>
</
telerik:RadImageEditor
>
public class GridBoundMultiSelectFilterColumn : GridBoundColumn
{
private readonly XrefGateway _xrefGateway = new XrefGateway();
protected override void SetupFilterControls(TableCell cell)
{
base.SetupFilterControls(cell);
cell.Controls.RemoveAt(0);
var comboBox = new RadComboBox() { ID = this.DataField + "Filter", AutoPostBack = true, CheckBoxes = true, EnableCheckAllItemsCheckBox = true};
IList<
string
> options = _xrefGateway.GetUniqueColumnValues(DataField);
foreach (var option in options)
{
comboBox.Items.Add(new RadComboBoxItem(option));
}
cell.Controls.AddAt(0, comboBox);
cell.Controls.RemoveAt(1);
comboBox.SelectedIndexChanged += comboBox_SelectedIndexChanged;
if(Filter != null)
{
foreach (RadComboBoxItem item in comboBox.Items)
{
item.Checked = Filter.Values.Contains(item.Text);
}
}
}
void comboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
var comboBox = (RadComboBox)sender;
if ((Filter == null || Filter.Values.Count == 0) && comboBox.CheckedItems.Count == 0)
return;
Filter = new MultiSelectFilter() { ColumnName = DataField };
foreach (RadComboBoxItem item in comboBox.CheckedItems)
{
Filter.Values.Add(item.Text);
}
var filterItem = comboBox.NamingContainer as GridFilteringItem;
filterItem.FireCommandEvent("CustomFilter", Filter);
}
protected override string GetFilterDataField()
{
return this.DataField;
}
private MultiSelectFilter Filter
{
get { return (MultiSelectFilter) ViewState["Filter"]; }
set { ViewState["Filter"] = value; }
}
}
function PrintReport() { |
var splitter = $find("<%= rsReport.ClientID %>"); |
var pane = splitter.getPaneById("<%= rcPane.ClientID %>"); |
if (!pane) return; |
var cssFileAbsPaths = new Array(); |
cssFileAbsPaths[0] = '<%= Me.MyAppPath %>/global/css/global.css'; |
cssFileAbsPaths[1] = '<%= Me.MyAppPath %>/common/css/tools.css'; |
pane.Print(cssFileAbsPaths); |
} |
class AppointmentInfo
{
private readonly string _id;
private string _subject;
private DateTime _start;
private DateTime _end;
private string _unit;
private string _clr;
private string _img;
public string ID
{
get { return _id; }
}
public string Subject
{
get { return _subject; }
set { _subject = value; }
}
public DateTime Start
{
get { return _start; }
set { _start = value; }
}
public DateTime End
{
get { return _end; }
set { _end = value; }
}
public string Unit
{
get { return _unit; }
set { _unit = value; }
}
public string Clr
{
get { return _clr; }
set { _clr = value; }
}
public string Img
{
get { return _img; }
set { _img = value; }
}
private AppointmentInfo()
{
_id =
Guid.NewGuid().ToString();
}
public AppointmentInfo(string unitid, DateTime start, DateTime end, string unit, string clr, string img)
:
this()
{
_subject = unitid;
_start = start;
_end = end;
_unit = unit;
_clr = clr;
_img = img;
}
public AppointmentInfo(Appointment source)
:
this()
{
CopyInfo(source);
}
public void CopyInfo(Appointment source)
{
Subject = source.Subject;
Start = source.Start;
End = source.End;
//Resource unit = source.Resources.GetResourceByType("unit");
//if (user != null)
//{
// UnitID = (int?)unit.Key;
//}
//else
//{
// UnitID = null;
//}
}
}
public
partial class Calendar : Common.PortalPage
{
private const string AppointmentsKey = "Telerik.Web.Examples.Scheduler.BindToList.CS.Apts";
 
private List<AppointmentInfo> UnitList
{
get
{
List<AppointmentInfo > sessApts = Session[AppointmentsKey] as List<AppointmentInfo>;
if (sessApts == null)
{
sessApts =
new List<AppointmentInfo>();
Session[AppointmentsKey] = sessApts;
}
return sessApts;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Session.Remove(AppointmentsKey);
ResourceType resType = new ResourceType("unit");
resType.ForeignKeyField =
"UnitID";
RadScheduler1.ResourceTypes.Add(resType);
RadScheduler1.Resources.Add(
new Resource("unit", 1, "unit1"));
RadScheduler1.Resources.Add(
new Resource("unit", 2, "unit2"));
RadScheduler1.Resources.Add(
new Resource("unit", 3, "unit3"));
LoadData();
}
RadScheduler1.DataSource = UnitList;
}
private void LoadData()
{
...get data from sql db
units = SIMS.BL.Presentation.Contracts.
Extensions.GetPortalCalendarUnits(this.UserCredential, request);
UnitList.Clear();
foreach (InspectionUnit Unit in units)
{
UnitList.Add (
new AppointmentInfo(Convert.ToString(Unit.UnitID), (DateTime)(Unit.InsTimeBlockStart),
(
DateTime)(Unit.InsTimeBlockEnd), Unit.Unit, Unit.Clr, Unit.Img));
}
}
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadScheduler1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<td valign="top" >
<telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="WeekView"
Width ="884px" Skin="Web20"
DayStartTime="07:00:00" DayEndTime="20:00:00"
DataKeyField="ID" DataStartField="Start" DataEndField="End" DataSubjectField="Subject"
OnAppointmentCreated="RadScheduler1_AppointmentCreated"
onappointmentclick="RadScheduler1_AppointmentClick"
OnNavigationComplete="RadScheduler1_NavigationComplete"
onappointmentinsert="RadScheduler1_AppointmentInsert"
>
<AdvancedForm Modal = "false" />
<TimelineView UserSelectable="false" />
<TimeSlotContextMenuSettings EnableDefault ="true" />
<AppointmentContextMenuSettings EnableDefault ="true" />
<Reminders Enabled="false" />
</telerik:RadScheduler>