5 Answers, 1 is accepted
This is a bit of a hack, but you can add text to the css class of the time slots using the server side TimeSlotCreated event, I have added the date and time of the slot to the css class like so:
e.TimeSlot.CssClass = ";" + e.TimeSlot.Start.ToString("dd/MM/yyyy HH:mm");
NB - The ";" just makes it easier to find the start of the date time
Using the javascript event OnNodeDropping you can get the html element that you have dropped on to:
var destNode = args.get_htmlElement();
destNode.className ...
You can then access the css class details and parse the className propery to get the date and time.
I have viewed the html and the className property definitely contains the date time, I haven't done anymore yet, but once you have got the date and time you could force a post back and pass the date and time as an argument and do somthing with it on the server side e.g. create another appointment in the scheduler. Like I said a bit of a hack.
What would be good though is if the time cells had a unique ID property that could be set or ideally drag and drop would work with divs as it does with other controls, but to be fair the scheduler control is excellent.
Hope this helps
Doug.
Great workaround Doug. Fortunately, we have taken care of this problem and the Q1 release supports the notion of time slots that have unique indexes. I am attaching a draft version of an example that demonstrates drag and drop between RadTreeView and RadScheduler. It includes client-side code to locate the time slot, the time can be obtained by calling its get_startTime() method.
The project is built against the latest SP1 build (trial included).
Kind regards,
Tsvetomir Tsonev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
That sounds like a better way to do it.
I must say that I am impressed with the quick turn around, I am also very impressed by the whole toolkit, certainly takes web projects to the next level.
Best Regards
Doug