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

ListView - ObservableCollection Visibility / Refreshing Issues.

4 Answers 132 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Headygains
Top achievements
Rank 1
Veteran
Headygains asked on 08 Jun 2020, 05:48 PM

I've created a(n) implementation of Bluetooth printer discovery for zebra printers. The listview I used to display the "DiscoveredPrinters" is a RadListView. 

I'm experiencing a nice array of issues relating to this endeavor, and now I'm resorting to this post.

Current Issues:

-#1 RadListView Items only display when screen is rotated Landscape

-#2 RadListView doesn't update when underlying ObservableCollection is updated (May be related to #1).

 

Code can be found here for reproduction, You may have to remove some non-public dependencies in order to run it.

 

Currently the Files related to this issue:

- MainPage

- MainPageViewModel

-Views/Settings/PrintersView.xaml(.cs)

 

Currently I am only using the single page (MainPage) and Single ViewModel (MainPageViewModel).

I then swap out the ContentView in the RadSlideDrawer in the MainPage to navigate through views.

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Headygains
Top achievements
Rank 1
Veteran
answered on 08 Jun 2020, 05:50 PM
Apologies the link to the repo with code is: https://github.com/headygains/Smart.Warehouse.Universal
0
Accepted
Lance | Manager Technical Support
Telerik team
answered on 08 Jun 2020, 06:13 PM

Hello Dalton,

Thank you for sharing the code, it was critical to discovering the problem. 

Problem

Please put aside a few minutes to carefully read this article which explains the issue and provides a couple solutions - Troubleshooting: Controls are not Appearing. In your case, the StackLayout at the root is breaking UI virtualization (the "not enough room" problem). 

Solution

Just remove the StackLayout. Since you already have a Grid, and the RadListView is in the star-sized RowDefinition, that's all you need for the root element

Note: Although a redraw when orientation changes temporarily resolves the issue, it's a lucky coincidence.

Further Assistance

If you have any further trouble, please open a Support Ticket so we can assist. A forum thread doesn't carry a guaranteed response time like your Priority Support license has. Although not relevant in this case because you have a GitHub repo, you can attach ZIP files with your code to a ticket.

We do our best to answer forum posts in a timely manner, but this is limited by current workload and can take a few days at worse. Whereas a Support Ticket is always answered within the ticket's timeframe.

Regards,
Lance | Manager - Technical Support
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Headygains
Top achievements
Rank 1
Veteran
answered on 08 Jun 2020, 06:50 PM
Thank you for such a quick response! I knew it would be something so minor that I was glossing over!
0
Lance | Manager Technical Support
Telerik team
answered on 08 Jun 2020, 07:20 PM

Hi Dalton,

I'm happy to see this resolved the issue!

If you would like to see a real world example of this kind of setup, you can review the official Telerik CRM demo I built on GitHub - Art Gallery CRM. Although I'm using MasterDetailPage + ContentPage instead of ContentViews, a lot of the same problem-states creep up. I overcame many of those common issues and it might be a good resource to keep handy.

If you would like a ContentPresenter + ContentView example, you can review the infrastructure I built for the LoginView VSExtensions Item Templates (just create an empty test project and add a LoginView).

Regards,
Lance | Manager - Technical Support
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ListView
Asked by
Headygains
Top achievements
Rank 1
Veteran
Answers by
Headygains
Top achievements
Rank 1
Veteran
Lance | Manager Technical Support
Telerik team
Share this question
or