This is a migrated thread and some comments may be shown as answers.

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

2 Answers 80 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Frederico Fernandes
Top achievements
Rank 1
Frederico Fernandes asked on 28 Feb 2012, 06:08 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Todorov
Telerik team
answered on 02 Mar 2012, 03:01 PM
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 >>
0
Frederico Fernandes
Top achievements
Rank 1
answered on 05 Mar 2012, 06:12 PM
Hello Ivan,

Thanks, your code resolves the problem.
Tags
Scheduler and Reminder
Asked by
Frederico Fernandes
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Frederico Fernandes
Top achievements
Rank 1
Share this question
or