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

RadDataGrid Binding to List

7 Answers 277 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Stavros
Top achievements
Rank 1
Stavros asked on 06 Feb 2018, 11:00 AM
I am binding a grid to a list and it doesn't appear anything but when I press a row the selected item changes. I even go to a next page with binding content from this row. This happens on iOS and Android.

7 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 06 Feb 2018, 06:10 PM
Hello Stavros,

I cannot replicate what you've reported. Here is a demo which uses a List<T> and it works as expected:




Further Investigation

We cannot tell what might be wrong with your implementation without seeing a reproducible. Do you have all three SkiaSharp NuGet packages and all of the DataGrid's required dependencies referenced?

If you've confirmed this and still see the problem, can you please reply back with either a runnable demo, or the following items:

- The data model
- The view model (or code-behind if you're loading the data here)
- The view (e.g. the XAML for the DataGrid and any connected resources)
- Platform and version information (e.g. Xamarin.Forms 2.5.0.xxx, UI for Xamarin 2017.x, targeting iOS

With that information I'll be able to debug it directly and offer any potential solution(s).

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Stavros
Top achievements
Rank 1
answered on 13 Feb 2018, 07:45 AM

I found it! My data were as Interface. The listview doesn't have any problem when data is formatted as interface and not a class.  

I just entered my data as ToList<object>().

My problem now is that when I am in Grid page and I go to another page when I pop back to grid page it doesn't show anything again. it has the same issues. I can press a line and do stuff but it

0
Stavros
Top achievements
Rank 1
answered on 13 Feb 2018, 11:14 AM
[quote]Stavros said:

I found it! My data were as Interface. The listview doesn't have any problem when data is formatted as interface and not a class.  

I just entered my data as ToList<object>().

My problem now is that when I am in Grid page and I go to another page when I pop back to grid page it doesn't show anything again. it has the same issues. I can press a line and do stuff but it doesn't.

[/quote]

 

Info Added:

Android is fine for all scenarios.

It doesn't appear any content on the iOS emulator. 

I change the code and I don't use the SelectedItem but the last of the IList<object> SelectedItems. 

The app is crashing only on the iOS emulator with:  Cannot access a object. Object name: 'DefaultRenderer'

 

0
Accepted
Stefan Nenchev
Telerik team
answered on 14 Feb 2018, 12:15 PM
Hello, Stavros,

The issue was recently reported by some other users as well so we have it logged as a bug report at our end. Its priority is very high so we will investigate it as soon as possible. You can track its progress on the following link from our Ideas & Feedback portal - DataGrid: [iOS]RadDataGrid disappears when navigating to another page and coming back to the one that hosts the control. Please subscribe to the item in order to receive automatic notifications when any progress is made.

Have a great rest of the week.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Stavros
Top achievements
Rank 1
answered on 14 Feb 2018, 12:23 PM
[quote]Stefan Nenchev said, Stavros,

The issue was recently reported by some other users as well so we have it logged as a bug report at our end. Its priority is very high so we will investigate it as soon as possible. You can track its progress on the following link from our Ideas & Feedback portal - DataGrid: [iOS]RadDataGrid disappears when navigating to another page and coming back to the one that hosts the control. Please subscribe to the item in order to receive automatic notifications when any progress is made.

Have a great rest of the week.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items

[/quote]

The bug from the second scenario is relevant to that?
When I select a row and go to next page I get this Exception(this only occurs on iOS):
 
at Foundation.NSObject.get_SuperHandle () [0x00015] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/Foundation/NSObject2.cs:416 
  at UIKit.UIView.InsertSubview (UIKit.UIView view, System.nint atIndex) [0x00042] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:1145 
  at Telerik.XamarinForms.Common.NativeBorderPainter.AddChild (Telerik.XamarinForms.Common.Paintables.Paintable paintable) [0x0004a] in <c177041f884d4c149efbac04b16a0954>:0 
  at Telerik.XamarinForms.Common.Painters.Painter.AddChild (Telerik.XamarinForms.Common.Paintables.Paintable paintable) [0x00015] in <c177041f884d4c149efbac04b16a0954>:0 
  at Telerik.XamarinForms.DataGrid.MasterArranger.AddChild (System.Object child, Telerik.XamarinForms.DataGrid.NonLayoutPanel childrenPanel) [0x0009d] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.DataGridSelectionDecorationsArranger.Telerik.XamarinForms.DataGrid.IDecorationPresenter<Telerik.XamarinForms.DataGrid.SelectionRegionModel>.GenerateDecoratorContainer () [0x00007] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.SelectionRegionController.CreateDecorator (Telerik.XamarinForms.DataGrid.DecorationPool`1[T] pool, Telerik.XamarinForms.DataGrid.DecorationType decorationType) [0x00010] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.SelectionRegionController.Arrange (Telerik.XamarinForms.DataGrid.ArrangeDataForDecorations horizontalArrangement, Telerik.XamarinForms.DataGrid.ArrangeDataForDecorations verticalArrangement, System.Collections.Generic.IEnumerable`1[T] selectionRegions) [0x0003e] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.GridModel.UpdateSelection (Telerik.XamarinForms.DataGrid.ArrangeDataForDecorations scrollableHorizontalArrangement, Telerik.XamarinForms.DataGrid.ArrangeDataForDecorations verticalArrangement) [0x000a2] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.GridModel.ArrangeLineDecorators (Telerik.XamarinForms.Common.Primitives.RadSize finalSize) [0x0020c] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.GridModel.ArrangeCells (Telerik.XamarinForms.Common.Primitives.RadSize finalSize) [0x0001a] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.GridModel.ArrangeGridInternal (Telerik.XamarinForms.Common.Primitives.RadSize availableSize) [0x00083] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.GridModel.ArrangeGrid (Telerik.XamarinForms.Common.Primitives.RadSize availableSize) [0x00000] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.RadDataGrid.UpdateUI (System.Double x, System.Double y, System.Double width, System.Double height) [0x00019] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.DataGrid.RadDataGrid.OnLayoutChildrenOverride (System.Double x, System.Double y, System.Double width, System.Double height) [0x00000] in <82ba0e2409ff45359c000b3b9678871c>:0 
  at Telerik.XamarinForms.Common.RadLayout`1[T].LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00007] in <c177041f884d4c149efbac04b16a0954>:0 
  at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x0014b] in D:\agent\_work\1\s\Xamarin.Forms.Core\Layout.cs:245 
  at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\agent\_work\1\s\Xamarin.Forms.Core\Layout.cs:205 
  at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Core\VisualElement.cs:637 
  at Xamarin.Forms.Layout.ForceLayout () [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Core\Layout.cs:115 
  at Xamarin.Forms.Layout.InvalidateLayout () [0x00016] in D:\agent\_work\1\s\Xamarin.Forms.Core\Layout.cs:185 
  at Telerik.XamarinForms.Common.RadLayout`1[T].EnsureLayoutAfterMeasure () [0x00008] in <c177041f884d4c149efbac04b16a0954>:0 
  at Telerik.XamarinForms.Common.Dispatcher+<>c__DisplayClass6_0.<ProcessItemsInQueue>b__0 () [0x00015] in <c177041f884d4c149efbac04b16a0954>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/Foundation/NSAction.cs:163 
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIApplication.cs:63 

 

 

0
Stefan Nenchev
Telerik team
answered on 19 Feb 2018, 11:21 AM
Hello, Stavros,

As for the original issue that you have reported, we could not replicate it. Did you have a look at Lance's response and the information he has provided? Have you tested the sample he has attached? If you are still experiencing the undesired effects, please try modifying the sample or provide one of your own which we can check and advise you further.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Stavros
Top achievements
Rank 1
answered on 20 Feb 2018, 09:53 AM

Hello Stefan,

Yes, I found the solution. The list was a list of type interface so I just added ToList<object>(). It's ok now.

 

Tags
DataGrid
Asked by
Stavros
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Stavros
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or