Select Resource ID from TimeLineView from mouse position

7 posts, 0 answers
  1. Karl balshaw
    Karl balshaw avatar
    3 posts
    Member since:
    Dec 2009

    Posted 02 Nov 2010 Link to this post

    Hi,

    I am using the TimeLineView and have a number of (1 or more) employees set as my resouces.

    I need to be able to identify the resource ID when the user right clicks on the radScheduler control to bring up the context menu.

    This inculdes if the user clicks the appointment, the cell or even the resource label (if possible).

    Any thoughts or guidance

    Many thanks

    Karl
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 05 Nov 2010 Link to this post

    Hello Karl,

    Thank you for writing.

    You can subscribe to the MouseDown of RadScheduler. In this event you can get the cell which is under the mouse cursor. From this cell you can take the parent view. This view has only one resource, because the RadScheduler is grouped by resources.
    Point point = this.radScheduler1.PointToClient(Cursor.Position);
    TimelineGroupingByResourcesElement groupedDayViewElement = this.radScheduler1.SchedulerElement.ViewElement as TimelineGroupingByResourcesElement;
    SchedulerCellElement cellElement = SchedulerUIHelper.GetCellAtPoint(point, groupedDayViewElement.GetTimelineElements());
    SchedulerTimelineViewElement timelneViewElement = cellElement.Parent.Parent as SchedulerTimelineViewElement;
    MessageBox.Show(timelneViewElement.View.GetResources()[0].Name);

    In case you have further questions, feel free to contact us.

    All the best,
    Dobry Zranchev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. gezim
    gezim avatar
    19 posts
    Member since:
    Aug 2012

    Posted 06 Feb 2012 Link to this post

    Hi, 
    I want to know if i can change header view of resources on Telerik Scheduler. I want to set it vertically :(
  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 06 Feb 2012 Link to this post

    Hello gezim,

    Currently, modifying the layout of resource headers is not supported. They are aligned vertically only in TimelineView. You can see this on the attached screenshot. To enable TimelineView, you can use the following code:
    this.radScheduler1.ActiveViewType = SchedulerViewType.Timeline;

    I hope this helps. Feel free to ask if you have any additional questions.

    All the best,
    Ivan Todorov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. gezim
    gezim avatar
    19 posts
    Member since:
    Aug 2012

    Posted 06 Feb 2012 Link to this post

    hmmm.. I was thinking how I can set resources header text like Timeline Grouping example. The header text is from bottom to top, how can I do it? any property??
  7. gezim
    gezim avatar
    19 posts
    Member since:
    Aug 2012

    Posted 06 Feb 2012 Link to this post

    see this picture :)
  8. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 09 Feb 2012 Link to this post

    Hi gezim,

    The resource header text in grouped TimelineView should be aligned from bottom to top by default. Nevertheless, you can the rotation angle of the text by using the following code:
    this.radScheduler1.SchedulerElement.SetResourceHeaderAngleTransform(SchedulerViewType.Timeline, -90);

    I hope you find this useful.

    All the best,
    Ivan Todorov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready