2017-07-10 45 views
0

上面的這段代碼是我的代碼的一部分。使用這段代碼,你可以得到光標所在的單元格,但是我想在光標所在的位置單獨獲取所選/當前單元格。我不明白如何使用SelectionBehavior.CurrentCell和SelectionBehavior。 CurrentCellElement性能如何獲得radScheduler中的當前單元格

Dim point As Point = Me.RadScheduler1.PointToClient(Cursor.Position) 

Dim groupedDayViewElement As TimelineGroupingByResourcesElement = TryCast(Me.RadScheduler1.SchedulerElement.ViewElement, TimelineGroupingByResourcesElement) 
Dim cellElement As SchedulerCellElement = SchedulerUIHelper.GetCellAtPoint(point, groupedDayViewElement.GetTimelineElements()) 
If cellElement IsNot Nothing Then 
    Dim timelneViewElement As SchedulerTimelineViewElement = TryCast(cellElement.Parent.Parent, SchedulerTimelineViewElement) 

回答

0

我VB.Net技能是非常生疏,但我轉換如何獲得當前選定的任命C#示例:

Dim selectedAppt As AppointmentElement = SchedulerUIHelper.GetSelectedAppointment(Me.RadScheduler1); 
Dim appt As Appointment = TryCast(selectedAppt.Appointment, Appointment); 
+0

謝謝你的答案。但這個答案是正確的,當你想在調度程序中獲得所選的約會而不是單元 – vicangel

+0

良好的調用 - Telerik控件是好的,但有很多不同的控件對象和它們的層,有時很難瀏覽以獲取你想。 – jaredbaszler

0

的答案是:

If Me.RadScheduler1.SelectionBehavior.HasCellsSelected Then 
     Dim cell = Me.RadScheduler1.SelectionBehavior.CurrentCellElement 
    End If 
相關問題