<
telerik:RadScriptManager
ID
=
"RadScriptManagerDefault"
runat
=
"server"
EnableScriptCombine
=
"false"
>
</
telerik:RadScriptManager
>
<
telerik:RadToolTipManager
runat
=
"server"
ID
=
"ToolTipManager"
AutoTooltipify
=
"true"
Position
=
"TopRight"
Skin
=
"Office2007"
>
</
telerik:RadToolTipManager
>
<
br
/><
br
/><
br
/>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
ToolTip
=
"halo"
></
asp:TextBox
>
<
br
/><
br
/>
<
telerik:RadDatePicker
ID
=
"RadDatePicker1"
runat
=
"server"
Width
=
"110"
>
</
telerik:RadDatePicker
>
<
br
/><
br
/>
<
telerik:RadDatePicker
ID
=
"RadDatePicker2"
runat
=
"server"
Width
=
"110"
>
</
telerik:RadDatePicker
>
Hi!
We wrote an acsx control and everything seems to work well except for the disabled state. Is it possible to override the image when disabled? (See attached image.) This does not seem to work. It appears to use the enabled images and then sets the opacity.
Thanks!
Michael
.checkboxUnchecked
{
background: #EBEFF3 url('/Images/CheckBoxUnchecked.png') no-repeat 0px 50% !important;
}
.checkboxChecked
{
background: #EBEFF3 url('/Images/CheckBoxChecked.png') no-repeat 0px 50% !important;
}
/* not working */
.checkboxChecked.rbDisabled
{
background: #EBEFF3 url('/Images/CheckBoxCheckedDisabled.png') no-repeat 0px 50% !important;
}
<
div
id
=
"divCheckboxControls"
style
=
"display: inline-block; white-space: nowrap; margin: 2px; padding: 10px; "
>
<
asp:Label
ID
=
"labelRequiredField"
runat
=
"server"
text
=
"*"
cssclass
=
"labelrequiredstyle"
Visible
=
"false"
/>
<
asp:Label
ID
=
"labelForCheckBox"
runat
=
"server"
text
=
"#"
cssclass
=
"labelstyle"
/>
<
asp:Label
ID
=
"labelForReadOnlyData"
runat
=
"server"
cssclass
=
"labelstylereadonly"
Visible
=
"false"
EnableViewState
=
"true"
/>
<
telerik:RadButton
ID
=
"checkBox"
runat
=
"server"
ToggleType
=
"CheckBox"
ButtonType
=
"ToggleButton"
AutoPostBack
=
"false"
CssClass
=
"checkBox"
DisabledButtonCssClass
=
"checkBox"
CausesValidation
=
"false"
EnableViewState
=
"true"
>
<
ToggleStates
>
<
telerik:RadButtonToggleState
Text
=
"."
PrimaryIconCssClass
=
"checkboxChecked"
/>
<
telerik:RadButtonToggleState
Text
=
"."
PrimaryIconCssClass
=
"checkboxUnchecked"
/>
</
ToggleStates
>
</
telerik:RadButton
>
</
div
>
<
telerik:RadGrid
ID
=
"grdMain"
runat
=
"server"
Width
=
"100%"
AutoGenerateColumns
=
"False"
ShowFooter
=
"false"
GridLines
=
"None"
AllowMultiRowSelection
=
"True"
BorderStyle
=
"None"
GroupingEnabled
=
"False"
Skin
=
"Windows7"
onitemcommand
=
"grdMain_ItemCommand"
onitemdatabound
=
"grdMain_ItemDataBound"
onsortcommand
=
"grdMain_SortCommand"
AllowSorting
=
"True"
>
<
ItemStyle
Wrap
=
"False"
/>
<
MasterTableView
TableLayout
=
"Fixed"
Width
=
"100%"
>
<
RowIndicatorColumn
>
<
HeaderStyle
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridClientSelectColumn
Resizable
=
"false"
Visible
=
"true"
>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridClientSelectColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"cmdView"
ImageUrl
=
"~/images/properties.png"
UniqueName
=
"View"
>
<
HeaderStyle
Width
=
"25px"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"cmdUpdate"
ImageUrl
=
"~/images/edit.png"
UniqueName
=
"Update"
>
<
HeaderStyle
Width
=
"25px"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
HeaderText
=
"First Name"
UniqueName
=
"FirstName"
DataFormatString="<nobr>{0}</
nobr
>">
<
HeaderStyle
Width
=
"100px"
/>
<
FooterStyle
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastName"
HeaderText
=
"Last Name"
UniqueName
=
"LastName"
>
<
HeaderStyle
/>
<
ItemStyle
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CardCode"
HeaderText
=
"Prox Card Code"
UniqueName
=
"CardCode"
>
<
HeaderStyle
Width
=
"100px"
/>
<
ItemStyle
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DoorCode"
HeaderText
=
"Door Code"
UniqueName
=
"DoorCode"
DataFormatString="<nobr>{0}</
nobr
>">
<
HeaderStyle
Width
=
"100px"
/>
<
FooterStyle
/>
</
telerik:GridBoundColumn
>
<
telerik:GridImageColumn
DataType
=
"System.Int32"
HeaderText
=
"Enabled"
DataImageUrlFields
=
"Enabled"
ImageAlign
=
"Middle"
AllowSorting
=
"true"
UniqueName
=
"Enabled"
>
<
HeaderStyle
Width
=
"100px"
HorizontalAlign
=
"Center"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridImageColumn
>
</
Columns
>
</
MasterTableView
>
<
HeaderStyle
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
Wrap
=
"true"
/>
<
ClientSettings
AllowKeyboardNavigation
=
"True"
AllowRowsDragDrop
=
"False"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"false"
UseStaticHeaders
=
"True"
/>
<
Resizing
AllowColumnResize
=
"true"
ClipCellContentOnResize
=
"true"
ResizeGridOnColumnResize
=
"true"
/>
</
ClientSettings
>
<
FooterStyle
Wrap
=
"false"
/>
</
telerik:RadGrid
>
if (e.Item is GridDataItem)
{
e.Item.Cells[grdMain.Columns.FindByUniqueName("Update").OrderIndex].ToolTip = "Update";
e.Item.Cells[grdMain.Columns.FindByUniqueName("View").OrderIndex].ToolTip = "View";
bool _SystemAdmin = Convert.ToBoolean(DataBinder.Eval(e.Item.DataItem, "Enabled"));
((Image)(((GridDataItem)e.Item)["Enabled"].Controls[0])).ImageUrl = "~/images/check_mark_checked.png";
if (!_SystemAdmin)
{
((Image)(((GridDataItem)e.Item)["Enabled"].Controls[0])).ImageUrl = "~/images/check_mark_unchecked.png";
}
}
I am trying to drag rows from a RadGrid containing all existing appointments to the scheduler in week-view. After dropping I want to check on collisions using your given clientside function overlapsWithAnotherAppointment.
Within the clientside RowDropping method I need to get the dragged appointment to pass it to overlapsWithAnotherAppointment. I tried getting this by using scheduler.get_appointments(). My problem now is the get_appointments() function only returns appointments which are visible within the Weekview-range.
We’re using Telerik 2011.2.915.40 using a custom SchedulerProvider in which we override the GetAppointments method. I can see this function does return all appointments, also the ones which are not visible.
What should I do so get_appointments() also returns the non-visible appointments ?
Thanks for any help,
Frank
Below are some code snippits of our implementation:
RadGrid from which rows are being dragged:
<
telerik:RadGrid
ID
=
"rgActiviteiten"
runat
=
"server"
GridLines
=
"None"
OnNeedDataSource
=
"rgActiviteiten_NeedDataSource"
Width
=
"100%"
AllowFilteringByColumn
=
"false"
ShowHeader
=
"false"
OnRowDrop
=
"rgActiviteiten_RowDrop"
DataKeyNames
=
"Activiteit_ID"
EnableViewState
=
"false"
>
<
ClientSettings
AllowRowsDragDrop
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientEvents
OnRowDropping
=
"rowDropping"
OnRowDblClick
=
"onRowDoubleClick"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"Activiteit_ID"
ClientDataKeyNames
=
"Activiteit_ID"
AllowFilteringByColumn
=
"False"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"P_Naam"
DataField
=
"P_Naam"
HeaderText
=
"Product"
ItemStyle-Wrap
=
"false"
ItemStyle-Width
=
"335"
/>
<
telerik:GridBoundColumn
DataField
=
"Activiteit_ID"
UniqueName
=
"Activiteit_ID"
Visible
=
"true"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadScheduler
ID
=
"rsSchedulerWithProvider"
runat
=
"server"
ProviderName
=
"MyDbSchedulerProvider"
Width
=
"1018px"
Height
=
"100%"
Culture
=
"nl-NL"
FirstDayOfWeek
=
"Monday"
SelectedView
=
"WeekView"
HoursPanelTimeFormat
=
"HH:mm"
CustomAttributeNames
=
"ActiviteitType_ID, Omschrijving, Activiteit_ID, Soort"
EnableRecurrenceSupport
=
"false"
EnableExactTimeRendering
=
"True"
OnClientNavigationCommand
=
"OnNavigationCommand"
AllowDelete
=
"false"
AllowEdit
=
"false"
OnAppointmentsPopulating
=
"rsSchedulerWithProvider_AppointmentsPopulating"
OnTimeSlotCreated
=
"rsSchedulerWithProvider_TimeSlotCreated"
OnResourcesPopulating
=
"rsSchedulerWithProvider_ResourcesPopulating"
OnClientAppointmentEditing
=
"OnClientAppointmentEditing"
OnClientAppointmentInserting
=
"CreateAppointment"
>
<
AppointmentTemplate
>
<
i
><%# Eval("Omschrijving")%></
i
>
</
AppointmentTemplate
>
<
WeekView
DayEndTime
=
"22:00:00"
WorkDayStartTime
=
"08:00:00"
WorkDayEndTime
=
"22:00:00"
/>
<
DayView
DayEndTime
=
"22:00:00"
WorkDayStartTime
=
"08:00:00"
WorkDayEndTime
=
"22:00:00"
/>
<
MonthView
UserSelectable
=
"false"
/>
<
TimelineView
UserSelectable
=
"false"
/>
</
telerik:RadScheduler
>
function rowDropping(sender, eventArgs) {
// Fired when the user drops a grid row
var htmlElement = eventArgs.get_destinationHtmlElement();
// Bij slepen van een appointment geen check
var isActiviteit = sender.get_id().indexOf('rgActiviteiten') > -1;
if (isPartOfSchedulerAppointmentArea(htmlElement)) {
// The row was dropped over the scheduler appointment area
// Find the exact time slot and save its unique index in the hidden field
var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
$get("TargetSlotHiddenField").value = timeSlot.get_index();
var activiteit = null;
if (isActiviteit) {
var activiteit_id = eventArgs.get_draggedItems()[0].getDataKeyValue("Activiteit_ID");
// NEXT LINE WILL GO WRONG SINCE scheduler.get_appointments() DOESN'T CONTAIN THE DRAGGED ITEM IF IT'S ORIGINAL DATE WAS OUTSIDE THE WEEKVIEW-RANGE
activiteit = scheduler.get_appointments().findByID(activiteit_id);
}
// Calculate the end time of the new appointment
// By default, new appointments span 2 rows, so we multiply the minutesPerRow property by 2
var endTime = new Date(timeSlot.get_startTime().getTime() + scheduler.get_minutesPerRow() * minute * 2);
// Check if the new appointment is overlapping with one of the existing appointments
var app = overlapsWithAnotherAppointment(activiteit, timeSlot.get_startTime(), endTime);
if ( app >= 0 ) {
eventArgs.set_cancel(true); // Cancel the event to prevent showing the insert form
}
// The HTML needs to be set in order for the postback to execute normally
eventArgs.set_destinationHtmlElement("TargetSlotHiddenField");
}
else {
// The node was dropped elsewhere on the document
eventArgs.set_cancel(true);
}
}