SchedulerUIHelper doesn't work anymore for items dragged to all day event cell

3 posts, 1 answers
  1. Frederico Fernandes
    Frederico Fernandes avatar
    20 posts
    Member since:
    Oct 2009

    Posted 28 Feb 2012 Link to this post

    Hi,

    It seems that this code doesn't work for items dragged to all day event cell:

    Point point = this.radScheduler1.PointToClient(new Point(e.X, e.Y)); 
    DayViewAppointmentsTable table = (this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewElement).DataAreaElement.Table; 
    SchedulerCellElement schedulerCell = SchedulerUIHelper.GetCellAtPoint(point, table.Children); 


    In my application i have a RadGridView and i drag items to scheduler. Before version Q3 2011 it was possible to drag items to all day event and schedulercell wasn't null, but after Q3 2011 (and Q1 2011) it isn't possible anymore because schedulercell is null. How can i have schedulercell not null when i drag items to all day event cell and have info about that cell day?


  2. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 02 Mar 2012 Link to this post

    Hello Frederico,

    Thank you for your question.

    I was not able to find any changes which can lead to this behavior. You might be using the code you have posted in a somehow specific scenario. Generally, the all-day cells are located in another element so you should use the following code to get them:
    Point point = this.radScheduler1.PointToClient(new Point(e.X, e.Y));
    DayViewAllDayHeader table = (this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewElement).AllDayHeaderElement;
    SchedulerCellElement schedulerCell = SchedulerUIHelper.GetCellAtPoint(point, table.Children);

    The code snippet you have posted gets a cell from the table that is below the all-day area and should not be able to return all-day cells. Note that in both cases the point variable should be in control coordinates. This means that you only need to call PointToClient if the e.X and e.Y are screen coordinates.

    I hope this information will help you. If you still need assistance, please send me a complete source code which demonstrates your scenario. This will let investigate it and provide you with a solution.

    Also, if you have any additional questions, feel free to ask.

    All the best,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Frederico Fernandes
    Frederico Fernandes avatar
    20 posts
    Member since:
    Oct 2009

    Posted 05 Mar 2012 Link to this post

    Hello Ivan,

    Thanks, your code resolves the problem.
Back to Top