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

GridView Crashes when trying to drag header

7 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 2
Nick asked on 25 Aug 2010, 08:30 PM
I liked the functionality that lets users group your results by column by dragging it to the bar above it. In the example, this works perfectly, but in my own implementation, Silverlight crashes as soon as you try to drag a column. It doesn't move an inch (re-order columns is not possible). Clicking the column header to reorder the contents by column does work.

I have created a screenshot of the crash error (http://www.sjele.nl/RadGridViewCrash.png) but was unable to attach a debugger (debugger already attatched error).

Used XAML:

 

 

 

 

<telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding ElementName=companySearchResultDomainDataSource, Path=Data}" Margin="15,2"
              RowIndicatorVisibility="Collapsed" IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False" 
              CanUserResizeColumns="False" Height="300" RowLoaded="RadGridView1_RowLoaded">
    <telerik:RadGridView.RowStyle>
        <Style TargetType="telerik:GridViewRow">
            <Setter Property="MinHeight" Value="40"/>
        </Style>
    </telerik:RadGridView.RowStyle>
    <telerik:RadGridView.Columns>
        <telerik:GridViewToggleRowDetailsColumn />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CompanyName}" Header="Company Name" /><!--Width="SizeToCells" MinWidth="110"-->
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Address}" Header="Address" /><!--Width="SizeToHeader" MinWidth="60"-->
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=ZipCode}" Header="Zip Code" /><!-- Width="SizeToHeader" MinWidth="70" -->
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=City}" Header="City" /><!-- Width="SizeToHeader" MinWidth="45" -->
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Country}" Header="Country" /><!--  Width="SizeToCells" MinWidth="65" -->
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=ParentCompanyID}" Header="Parent Company ID" /><!-- Width="SizeToHeader" -->
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=ChildCompanies}" Header="Child Companies" /><!-- Width="SizeToHeader" -->
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

The ItemsSource results a List<CompanySearchResult> via WCF RIA Services.

You can use the definition below and just feed a faked list to test.

/// <summary>
/// A compacted result for the search screen.
/// </summary>
/// <remarks>
/// In order to lift along with the WCF RIA Services, 
/// the data structure needs to be a class with properties; 
/// public exposed variables or structures are not accepted.
/// </remarks>
[Serializable()]
public class CompanySearchResult
{
    [Key] // A Key Attribute is required to work along with the WCF RIA Services.
    public int CompanyID{get;set;}
    public Nullable<int> ParentCompanyID{get;set;}
    public String CompanyName { get; set; }
    public String Address { get; set; }
    public String ZipCode { get; set; }
    public String City { get; set; }
    public String Country { get; set; }
    public int ChildCompanies { get; set; }
    public int[] ChildCompanyIDs { get; set; }
}

If you need additional information, please let me know.

 

 

 

In order to make sure you can confirm the problem quickly, I've set up a live minimal demo for you at http://radgridviewcrash.nkcss.com/RadGridViewCrashTestPage.aspx  and https://ziggo.nkcss.com/radgridviewcrash/RadGridViewCrashTestPage.aspx  but the weird thing is, when visited via IIS, on my remote or dev machine, it won't crash, but also not allow you to drag.

When debugging in visual studio 2010 (cassini dev webserver), Silverlight will crash (see attatched source).

The Source is 9.42MB due to all the libraries, etc...: http://radgridviewcrash.nkcss.com/RadGridViewCrash.zip

Someone just posted with the same error: http://www.telerik.com/community/forums/silverlight/gridview/gridview-drag-header-crashes-with-value-does-not-fall-within-the-expected-range.aspx

7 Answers, 1 is accepted

Sort by
0
Accepted
Tsvyatko
Telerik team
answered on 26 Aug 2010, 04:18 PM
Hello Nick,

  Ihave investigated this issue you are facing and it does not occurs using the latest internal build (2010.2.0821) anymore. Please have a look at the attached project and let me know if you have further issues.

Best wishes,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nick
Top achievements
Rank 2
answered on 26 Aug 2010, 05:04 PM
Awesome, this latest build fixes things...

When will there be a new build released that I can redistribute?
0
Hristo
Telerik team
answered on 30 Aug 2010, 08:09 AM
Hello Nick,

If you are referring to when our next official release will be available, Q3 2010 is scheduled for the middle of November. Latest Internal Builds are shipped every Friday.

All the best,
Hristo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ron Verhagen
Top achievements
Rank 1
answered on 15 Apr 2011, 03:10 PM
Hello,

I have the similar issue, i m not dragging the header. I m dragging the row of the grid.

I have a two grid , and drag and drop an item from one grid to another. Not every time but many times i m getting an error
"System.ArgumentException: Value does not fall within the expected range." Detail of the error is

Message: Unhandled Error in Silverlight Application
Code: 4004    
Category: ManagedRuntimeError       
Message: System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.UIElement.TransformToVisual(UIElement visual)
   at Telerik.Windows.Controls.DragDrop.SimulatedDragDropProvider.AdjustScrollViewer(IScrollViewerAdapter viewer, Point currentPoint)
   at Telerik.Windows.Controls.DragDrop.SimulatedDragDropProvider.OnRealDrag(IMouseEventArgs e)
   at Telerik.Windows.Controls.DragDrop.SimulatedDragDropProvider.OnCoverRectangleMouseMoveInternal(IMouseEventArgs e)
   at Telerik.Windows.Controls.DragDrop.SilverlightDragDropProvider.OnCoverRectangleMouseMove(Object sender, MouseEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)     

Line: 64
Char: 13
Code: 0

I am using the latest build that is  2011.1.405.1040


Can you please guide me  for the same..

0
Tsvyatko
Telerik team
answered on 18 Apr 2011, 09:18 AM
Hi Michel van Krimpen,

 Would it be possible to send us sample application that reproduces the problem, we are unable to reproduce it from our side (you can open support ticket to attach the project).

Meanwhile I can suggest to try simple workaround - setting RadDragAndDropManager.AutoBringIntoView = false;

All the best,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ron Verhagen
Top achievements
Rank 1
answered on 18 Apr 2011, 11:34 AM
Thanks for your reply,

Yes by setting the RadDragAndDropManager.AutoBringIntoView = false solve the problem. Now i can not get any error.

But as per my requirement i must need to set the AutoBringIntoView  to true.

Is there any other way to sort out this problem without setting AutoBringIntoView  to false?


Thanks in advance,
Krupa
0
Tsvyatko
Telerik team
answered on 19 Apr 2011, 09:16 AM
Hello Michel van Krimpen,

 Would it be possible to send us sample application that reproduces the problem (you can open support ticket to attach the project). That way we can investigate the problem from our side and provide appropriate solution.

Kind regards,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Nick
Top achievements
Rank 2
Answers by
Tsvyatko
Telerik team
Nick
Top achievements
Rank 2
Hristo
Telerik team
Ron Verhagen
Top achievements
Rank 1
Share this question
or