or
private void GridView_EditorRequired(object sender, EditorRequiredEventArgs e){ if (e.EditorType == typeof(RadMultiColumnComboBoxElement)) { PersonChecker newEditor = new PersonChecker(); e.Editor = newEditor; } }public class PersonChecker : BaseInputEditor{ public override object Value { get { String all = ""; RadMultiColumnComboBoxElement editor = ((RadMultiColumnComboBoxElement)this.EditorElement); foreach (GridViewRowInfo gvri in editor.Rows) { if (Convert.ToBoolean(gvri.Cells[0].Value) == true) { if (all != "") all += "; "; all += Convert.ToString(gvri.Cells[1].Value); } } return all; } set { Console.WriteLine("to do"); } } protected override RadElement CreateEditorElement() { RadMultiColumnComboBoxElement editor = new RadMultiColumnComboBoxElement(); editor.EditorControl.AutoGenerateColumns = false; editor.Columns.Clear(); GridViewCheckBoxColumn check = new GridViewCheckBoxColumn(); check.HeaderText = ""; check.Name = "Check"; check.MinWidth = 40; check.MaxWidth = check.MinWidth; check.ReadOnly = false; editor.Columns.Add(check); GridViewTextBoxColumn username = new GridViewTextBoxColumn(); username.HeaderText = "Username"; username.Name = "Username"; username.MinWidth = 200; editor.Columns.Add(username); editor.Rows.Clear(); editor.Rows.Add(new Object[] { false, "Person 1" }); editor.Rows.Add(new Object[] { false, "Person 2" }); editor.Rows.Add(new Object[] { false, "Person 3" }); //foreach (Person person in FormMain._persons) //{ // editor.Rows.Add( // new Object[] { false, person.SP_Username } // ); //} editor.EditorControl.ShowRowHeaderColumn = false; editor.AutoSizeDropDownToBestFit = true; editor.PopupClosing -= Editor_PopupClosing; editor.PopupClosing += Editor_PopupClosing; editor.EditorControl.CellClick -= EditorControl_CellClick; editor.EditorControl.CellClick += EditorControl_CellClick; return editor; } private void EditorControl_CellClick(object sender, GridViewCellEventArgs e) { if (e.ColumnIndex == 0 && e.RowIndex > -1) { e.Row.Cells[0].Value = !Convert.ToBoolean(e.Row.Cells[0].Value); } } private void Editor_PopupClosing(object sender, RadPopupClosingEventArgs args) { if (args.CloseReason == RadPopupCloseReason.Mouse) { args.Cancel = true; } } public override void BeginEdit() { base.BeginEdit(); this.EditorElement.Focus(); } public override bool EndEdit() { return base.EndEdit(); } public override Type DataType { get { return typeof(string); } }}Dim colors() As Color = {Color.Transparent, Color.Transparent, Color.Transparent, Color.Transparent} Dim names() As String = {"User 1", "User 2", "User 3", "User 4"} For i As Integer = 0 To names.Length - 1 Dim resource As New Telerik.WinControls.UI.Resource() resource.Id = New EventId(i) resource.Name = names(i) resource.Color = colors(i) 'resource.Image = Me.imageList1.Images(i) Me.RadScheduler1.Resources.Add(resource) Next i Me.RadScheduler1.GroupType = GroupType.Resource Me.RadScheduler1.ActiveView.ResourcesPerView = 2 Catch ex As ExceptionHi all,
Is there a way to hide non working hours in TimelineView with Timescales.Hours/HalfHours/Minutes
e.g. collapse Columns before and after the WorkTime-Timespan - thus allowing shorter drag+Drop movements
| Day 1 | Day 2 |
| 08 09 10 11 12 13 14 16 18 20| 08 09 10 11 12 13 14 16 18 20|
Currently I call my own RenderView() method which loops over all visible cells
void ActiveView_PropertyChanged(object sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case "StartDate":It would be more convinient to subscribe to a ElementRender Event and set the background color there - like the one exposed in RadCalendar.
''' <summary>''' Sql Server notifies the scheduler table data is changed!''' The current scheduler data needs to rebind to reflect the changes...''' </summary>''' <param name="sender"></param>''' <param name="e"></param>''' <remarks></remarks>Private Sub AgendaWijziging(sender As Object, e As System.Data.SqlClient.SqlNotificationEventArgs) If Me.InvokeRequired Then RadScheduler1.BeginInvoke(New MethodInvoker(AddressOf radScheduler1_rebind)) Else radScheduler1_rebind() End IfEnd Sub''' <summary>''' Rebind the scheduler after a database change by another client''' </summary>''' <remarks></remarks>Private Sub radScheduler1_rebind() Try Me.Cursor = Cursors.WaitCursor ' attempt to find current first time slot in view (user scrolled to this time slot) 'Dim dayView As SchedulerDayViewGroupedByResourceElement = TryCast(Me.RadScheduler1.SchedulerElement.ViewElement, SchedulerDayViewGroupedByResourceElement) 'Dim singleDayView As SchedulerDayViewElement = Nothing 'Dim resetToTime As DateTime? = Nothing 'Dim firstCell As SchedulerCellElement 'If dayView IsNot Nothing Then ' singleDayView = dayView.GetDayViewElements.FirstOrDefault ' If singleDayView IsNot Nothing Then ' firstCell = singleDayView.DataAreaElement.Table.Children.First ' If firstCell IsNot Nothing Then ' resetToTime = CType(cell, SchedulerCellElement).Date (date only... no time?)
' End If ' End If 'End If RadScheduler1.DataBind() ' go back to the timeslot the user scrolled to.. (does not work :( resetToTime contains date only )
'If singleDayView IsNot Nothing AndAlso resetToTime IsNot Nothing Then ' singleDayView.DataAreaElement.Table.ScrollToTime(New TimeSpan(resetToTime.Value.Hour, resetToTime.Value.Minute, resetToTime.Value.Second)) 'End If ' re-initialize the sql broker notification _context.MonitorAgenda() Catch ex As Exception Dim currentMethode As MethodBase = MethodBase.GetCurrentMethod FormHelper.LogError(ex, currentMethode.DeclaringType.ToString, currentMethode.ToString) Finally Me.Cursor = Cursors.Arrow End TryEnd Sub