Hi All,
I'm evaluating the new 2011 Q2 release and so far I just found an issue with the drag And Drop feature:
Error 'Value does not fall within the expected range'
This happens exactly when I start dragging.
With the previous telerik version it was working fine.
Are there any thoughts on how to fix this ?
Thanks,
Nuno
9 Answers, 1 is accepted
We would really appreciate it if you could send us more information about this issue. A sample project would be ideal but if sending us one is not possible a stack trace or any other relevant information would also help us identify and fix the problem.
Greetings,
Milan
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Hi Milan,
I'm sorry I couldn't provide enough information yesterday.
My VS2010 solution is very big and complex, so it's not easy to extract a sample.
Though, I detected the method and line of code responsible for the issue!
I'm having problems setting the DragCue property. I'm getting the exception you can see in the attached file.
Again, this code used to work before upgrading to the 2011 Q2 version.
Here is the code where the problem exists:
private
void
OnDragQuery(
object
sender, DragDropQueryEventArgs e)
{
try
{
if
(sender
is
PartContainer)
{
e.QueryResult =
true
;
if
(e.Options.Status == DragStatus.DragQuery)
{
e.Options.DragCue = sender;
}
}
}
catch
(Exception ex)
{
Global.logAgent.WriteLogEntry(ex);
}
}
It breakes in this line =>
e.Options.DragCue = sender;
Shows an ugly message box and doesn't event fall in the catch section.
I need help asap because today is the deadline to evaluate the 2011 Q2 version.
Thanks a lot!
Regards,
Nuno
Hi again,
The basic idea behind the code is the DragCue to be the sender itself (sender = PartContainer = a UserControl).
So the user sees the UserControl being dragged to the choosen destination.
If I set DragCue like this it works BUT not as desired:
e.Options.DragCue =
RadDragAndDropManager.GenerateVisualCue((PartContainer)sender);
(shows a yellow rectangle with yellow Fill)
The wanted version (which used to work) is:
e.Options.DragCue = (PartContainer)sender;
(it should show the actual visuals of the UserControl being dragged)
Thanks for your help!
Regards,
Nuno
Thank you for sharing this information with us. It helped us get better idea of the problem you are facing.
In your scenario the sender on drag query (which usually is the drag source and is already in visual tree) is assigned to visualCue (which is added in the visual tree - popup). This will lead to exception - Element is already a child of another element.
We have tested this with several older versions, back to 2010.1.319, and get the same result, so we are not sure which version had been used. Nevertheless, the infrastructure was not designed to work in such scenarios.
However, I can suggest you several simple solutions that will meet the scenario requirements.
- Add RadDragAndDropManager.AutoDrag=true - define it in the same way and on the same control as the RadDragAndDropManager.AllowDrag=true. This will create snapshot of the source dragged element and use it as drag cue.
- Create drag cue in DragQuery event similar to these examples - http://demos.telerik.com/silverlight/#DragAndDrop/FirstLook
http://demos.telerik.com/silverlight/#DragAndDrop/TreeToGrid
http://www.telerik.com/help/silverlight/raddraganddrop-howto-create-custom-drag-cue.html
Please have a look at the resources above and let us know if you have any further issues or questions.
Tsvyatko
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Hi Telerik Team,
We decided to roll back to the 2011 Q1 SP1 version where I can make the control itself be dragged.
It also used to work with our previous installed version 2010.3.1110.1040.
Please see the attached file. It's a working version with code I mentioned before.
Regards,
Nuno
Thank you for sharing this information. We will take in mind this scenario and consider it in future releases.
Greetings,Tsvyatko
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
We are looking forward for that. It will allow us to upgrade to the 2011 Q2+ release and take advantage of all the new great controls/features!
Thank you,
Nuno
Hi Guys,
I’m also having the same issue with the Q2 release.
I will try your suggestions above but can you confirm that this behaviour has changed in the Q2 release?
(I believe we are using the control/manager correctly according to the online documentation)
Thanks,
Matt