UWP project in VS 2017 supported?

7 posts, 0 answers
  1. Jim
    Jim avatar
    1 posts
    Member since:
    Nov 2010

    Posted 31 Mar Link to this post

    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

  2. Ves
    Admin
    Ves avatar
    2903 posts

    Posted 05 Apr Link to this post

    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
  3. Jim
    Jim avatar
    3 posts
    Member since:
    Mar 2017

    Posted 05 Apr in reply to Ves Link to this post

    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

  4. Ves
    Admin
    Ves avatar
    2903 posts

    Posted 10 Apr Link to this post

    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
  5. Jim
    Jim avatar
    3 posts
    Member since:
    Mar 2017

    Posted 11 Apr in reply to Ves Link to this post

    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

  6. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    316 posts

    Posted 12 Apr Link to this post

    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
  7. Jim
    Jim avatar
    3 posts
    Member since:
    Mar 2017

    Posted 13 Apr in reply to Lance | Tech Support Engineer, Sr. Link to this post

    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

     

Back to Top