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

2011 Q2 release - Error 'Value does not fall within the expected range'

9 Answers 100 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Dennis Perlot
Top achievements
Rank 1
Dennis Perlot asked on 14 Jul 2011, 11:38 PM

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

Sort by
0
Milan
Telerik team
answered on 15 Jul 2011, 07:05 AM
Hi Dennis Perlot,

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!

0
Dennis Perlot
Top achievements
Rank 1
answered on 15 Jul 2011, 02:58 PM

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

0
Dennis Perlot
Top achievements
Rank 1
answered on 15 Jul 2011, 04:03 PM

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

0
Tsvyatko
Telerik team
answered on 15 Jul 2011, 04:14 PM
Hello Dennis Perlot,

 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.

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!

0
Dennis Perlot
Top achievements
Rank 1
answered on 15 Jul 2011, 07:47 PM

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

0
Tsvyatko
Telerik team
answered on 19 Jul 2011, 09:05 AM
Hi Dennis Perlot,

 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!

0
Dennis Perlot
Top achievements
Rank 1
answered on 19 Jul 2011, 09:46 PM
Hi Telerik Team,

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

0
Matt
Top achievements
Rank 1
answered on 30 Jul 2011, 03:38 AM

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

0
Matt
Top achievements
Rank 1
answered on 30 Jul 2011, 09:04 AM
Ah, found the "Legacy" mode setting. thanks.
Tags
DragAndDrop
Asked by
Dennis Perlot
Top achievements
Rank 1
Answers by
Milan
Telerik team
Dennis Perlot
Top achievements
Rank 1
Tsvyatko
Telerik team
Matt
Top achievements
Rank 1
Share this question
or