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

Problem with Sorting on a Grid that has Nested Items

2 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 31 Oct 2011, 04:38 PM
We have a problem with the RadGridView, when we have at our top level a collection full of "GroupDto"'s..
Below this we have "GroupMemberDto" Items...

so in our list we potentially have for example...

- GroupDto 1
          - GroupMemberDto 1
          - GroupMemberDto 2
+ GroupDto 2
- GroupDto 2
          - GroupMemberDto 3
          - GroupMemberDto 4
          - GroupMemberDto 5
          - GroupMemberDto 6
- GroupDto 4


So the problem occurs, when we have a top level item selected say "GroupDto1" and "GroupMemberDto1" selected....

then the problem occurs if we try to sort by one of the fields on GroupMemberDto... we get the following error
"Unable to cast object of type 'BusinessPort.Agility.Core.Shared.DataTransferObjects.GroupMemberDto' to type 'BusinessPort.Agility.Core.Shared.DataTransferObjects.GroupDto'."

a copy of the call stack we get is...

Telerik.Windows.Data.dll!Telerik.Windows.Data.FuncExtensions.ToUntypedFunc<BusinessPort.Agility.Core.Shared.DataTransferObjects.GroupDto,string>.AnonymousMethod__0(object item) Line 24 + 0x34 bytes   C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.FunctionComparer.Compare(object x, object y) Line 34 + 0x1c bytes C#
[External Code]
Telerik.Windows.Data.dll!Telerik.Windows.Data.KeyedCollection.IndexOf(object value) Line 224 + 0x1e bytes   C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.InternalIndexOf(object item) Line 1745 + 0x1a bytes   C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.IndexOf(object item) Line 1735 + 0xc bytes    C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.IndexOf(object value) Line 386 + 0x19 bytes    C#
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoViewRecursive(System.Windows.FrameworkElement element, System.Collections.Generic.Stack<object> itemStack, System.Action<System.Windows.FrameworkElement> scrollFinishedCallback, System.Action scrollFailedCallback) Line 309 + 0x19 bytes   C#
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollRowIntoViewInternal(object dataItem, System.Action<System.Windows.FrameworkElement> scrollFinishedCallback, System.Action scrollFailedCallback) Line 254  C#
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoViewAsync.AnonymousMethod__57() Line 95 + 0x2a bytes  C#
[External Code]

And some further details...

 
Locating source for 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'. Checksum: MD5 {b7 2f 2f f ce 2e 64 af 4c 3d 12 d7 27 d7 88 35}
The file 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs' does not exist.
Looking in script documents for 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'...
Looking in the projects for 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs.
The debugger could not locate the source file 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'.

Hope this all makes sense, Let me know if you have any suggestions on how we can solve this, or if you require further information?

2 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 23 Nov 2011, 01:01 PM
Just wondering if anyone had any ideas on this issue?!
0
Vlad
Telerik team
answered on 25 Nov 2011, 01:43 PM
Hi,

 Can you post more info about your grid version? Is it our latest Q3 2011?

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Kevin
Top achievements
Rank 2
Answers by
Kevin
Top achievements
Rank 2
Vlad
Telerik team
Share this question
or