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

UWP project in VS 2017 supported?

6 Answers 148 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 01 Apr 2017, 12:04 AM

Everywhere in the documentation it says it works, but I can't get it working. I'm trying to use this in my UWP emulator and the ListView shows up (I see a background color), but no items. I've tried using my personal project as well as sample code from the Telerik help pages on the control. No matter which I try, I don't get anything to show up in the list. Here is one of the code samples I tried:

XAML

    <telerikDataControls:RadListView x:Name="lstTopics" VerticalOptions="Fill" HorizontalOptions="Fill" BackgroundColor="Yellow">
        <telerikDataControls:RadListView.ItemTemplate>
            <DataTemplate>
                <telerikListView:ListViewTemplateCell>
                    <telerikListView:ListViewTemplateCell.View>

                        <Label Text="This is a row" TextColor="Black" BackgroundColor="Blue" />

                    </telerikListView:ListViewTemplateCell.View>
                </telerikListView:ListViewTemplateCell>
            </DataTemplate>
        </telerikDataControls:RadListView.ItemTemplate>
    </telerikDataControls:RadListView>

 

Code Behind

lstTopics.ItemsSource = new ObservableCollection<string> { "one", "two", "three" };

 

Any ideas or a sample project I can download that works?

Thanks,

Jim

6 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 05 Apr 2017, 06:22 AM
Hi Jim,

We are not aware of such issue with RadListView. Please, find attached a small example, based on your code along with a screenshot of the result on my end.

Best regards,
Ves
Telerik by Progress
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
Jim
Top achievements
Rank 1
answered on 05 Apr 2017, 04:34 PM

Hi Ves,

Thank you for the reply. When I download and run the project you attached it works. When I copied the StartPage.xaml and StartPage.xaml.cs into my project it didn't work. Also when I created a brand new project and copied those pages in it didn't work. So I'm not sure what the difference is.

I'm not sure if this is related or not, but when I first started your sample project it asked me to install a Windows 10 SDK that wasn't needed for my project. Is there some project related setting I'm missing that is needed for it to work?

Here is the brand new project I created that doesn't work. I literally just created the project, copied in the page and necessary dlls, then ran it: https://drive.google.com/file/d/0B-cKIubrPmt7Z1hTSmpaRlphRzA/view?usp=sharing

Thanks,

Jim

0
Ves
Telerik team
answered on 10 Apr 2017, 08:25 AM
Hi Jim,

It seems you have not added all the required references to your project. In our online help, in every  control's chapter, there's a Getting Started folder and inside it you will find a topic named "Required Telerik Assemblies". For RadListView, you can find it here.

That said, with R3, expected in the beginning of May, we will introduce a new approach, aiming to decrease the number of required references, but at the moment, you will need to follow the above mentioned help topic.

Best regards,
Ves
Telerik by Progress
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
Jim
Top achievements
Rank 1
answered on 11 Apr 2017, 04:56 PM

Hi Ves,

Thank you for the response. Glad to hear you guys are going with a different approach in the new version. It's frustrating when it takes over a week to get the most basic sample running.

So on that note, I tried what you said and still can't get the ListView to show in my project. I added a link to every dll needed and even double checked all of my references against the project you uploaded. I still get the exact same behavior. Here is a link to download the new version of the test project, any ideas? We did purchase, should I move this to a support request?

https://drive.google.com/file/d/0B-cKIubrPmt7TWNmWGh1Mkg4ZDQ/view?usp=sharing

Thanks,
Jim

0
Lance | Manager Technical Support
Telerik team
answered on 12 Apr 2017, 07:41 PM
Hi Jim,

One easy way to know what references to use, is to create a project using the Telerik Project Wizard. It will create a full Xamarin Forms solution for each platform with all of the required renderers, references and all the Init calls.

Problem 
This last part is what the UWP app was missing, you missed the last step in the Getting Started Section "Register ListView Renderer": 




In your UWP app's MainPage.xaml.cs you need to declare the renderer as well as call TelerikForms.Init().

I've reattached your demo (please read my "attached demo" paragraph below before running it), for your convenience here's a screenshot of the fix:




Problem Fix Summary
When using the control, you need to declare it's renderer as well as the Init method. This is true for each platform. You'll find the instructions for each under the Getting Started section just like you did for RadListView.

I strongly recommend doing at least one File > New > Project > TelerikXFApp and keep it around as a reference project. You'll always be able to go back to it in case you need to know what needs to be added.


Attached Demo
The attached demo is only a few KB because I removed the bin/obj folders as well as replaced the DLLs you put into the Portable project for the ones that are installed on your machine at the default location. You should only reference them from here: C:\Program Files (x86)\Telerik\UI for Xamarin R1 2017\Binaries

Once you open the demo, do a Rebuild > Solution to restore the packages and you can deploy it. This is what you should see:




Conclusion

I hope I was able to help get you up and running. If not, please feel free to open a Support Ticket now that you have a license and either I or one of my colleague from the Xamarin engineering team will investigate further.


Side Tip:
When zipping up projects, if you delete removed projects as well as the Packages, bin and obj folders from existing projects, the zip size will drop from 28 MB to just a few KB. The reason for this is that you're no longer redistributing all the DLLs (including any paid versions) as well as the compiled version of each project until you delete those folders.

Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
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
Jim
Top achievements
Rank 1
answered on 13 Apr 2017, 04:57 PM

Hi Lance,

The issue was the missing registering of the renderers. Makes total sense now, but I'm still new to Xamarin so didn't think about that. Thank you very much for your help. Also I removed the linked example file and will exclude unnecessary dlls in the future.

Thanks,
James

 

Tags
ListView
Asked by
Jim
Top achievements
Rank 1
Answers by
Ves
Telerik team
Jim
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
Share this question
or