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

Grid as MainContent not showing on UWP

8 Answers 98 Views
SideDrawer
This is a migrated thread and some comments may be shown as answers.
Jacopo
Top achievements
Rank 1
Jacopo asked on 15 Feb 2017, 11:54 AM

Hi!

I'm trying and using the RadSideDrawer control in my application but I've got an UWP visualization error.

I'm setting a Grid (Layout) as the MainContent for my RadSideDrawer. Now, everything works fine with Android (I didn't get the chance to test it on iOS) but that MainContent is not displaying on UWP.

Is there any known limitation on MainContent use for UWP?

Note that:

- if I set the MainContent as a Label, it displays correctly in UWP too

- I added all the assemblies required (except the "Telerik.UI.Xaml.Primitives" dll, since what I could find in the UWP folder - UI for Xamarin R1 2017 - was the "Telerik.UI.Xaml.Primitives.UWP" dll, which I added instead) and registered all the renderers required

Thanks,

Jacopo

8 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 15 Feb 2017, 06:04 PM
Hello Jacopo,

There aren't any known issues with using <Grid/> for the MainContent's root View. In fact, this is recommended as it has finite bounds and will properly layout child elements that use UI virtualization.

I did test this and was not able to replicate the issue on my end, here's a screenshot of a RadSideDrawer with only a Grid and MainContent:




I have attached my demo so you can inspect it directly (be sure to do a full Solution > Rebuild to restore packages and references).


If you're still getting the error after reviewing my demo:


Can you please reply and share the your code with us? Please also include any relevant code-behind/view model. Once you reply, I will be able to debug it directly and investigate further.


Tip

I highly recommend using the Telerik Project Wizard to create a full Xamarin Forms solution with Android, iOS and UWP projects with all the renderers, references and TelerikForms.Init calls already put in there for you.  You can create a project with the wizard to keep as a reference to look at when you need to know what to add to existing projects. This is what I used to bootstrap the attached demo.

If you're more comfortable with nuget packages instead of manually adding references, you could use the Telerik Nuget Server and use the UI for Xamarin nuget package instead. See here for instructions.

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
Jacopo
Top achievements
Rank 1
answered on 16 Feb 2017, 09:13 AM

Hi Lance!

Thanks for your suggestion.

As a matter of fact, I've tried with a simple Grid and everything works just fine. So, I think I've narrowed down my issue.

My Grid contained something standard plus a ScrollView containing some CustomizedButtons.I think the problem is the ScrollView nested in the Grid.

In fact, I've tried replacing the CustomizedButtons with a simple Button or a Label and UWP project still didn't show me anything. I've replaced the ScrollView with a StackLayout and everything worked just fine. (Note that with Android everything works great with any combination)

Does this ring any bells to you? If not, let me know and I'll send you a working-yet-simplified code from my project in order for you to debug this issue.

Thanks,

Jacopo

0
Lance | Manager Technical Support
Telerik team
answered on 16 Feb 2017, 03:21 PM
Hi Jocobo,

As you suspected, at this point we'll need an isolated repro to debug directly. There are two routes you can take:

1- Use my demo (the best option)
You can update the demo app I sent so that it reproduces the issue and send that back to me. This would be the best option as it effectively isolates the issue.

2 - Use your project
If you do send us your original project, please make sure that it's runnable (i.e. no external dependencies that won't resolve, etc).

Once I see your reply, I'll start debugging and get back to you as soon as I've completed my investigation.

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
Jacopo
Top achievements
Rank 1
answered on 16 Feb 2017, 04:42 PM

Hi Lance!

Why not both?

1 - As for your demo, just add this code inside your Grid

        <ScrollView>
             <Label Text="Hello"/>
        </ScrollView>

You'll see it won't work. I can show you what I can see rendered with those lines of code (in this image) and commenting them (in this one).

2- You can find my simplified project at this link. Note that I'm developing using C# only, but the final result is the same as your XAML-written demo. Also, I started this new simplified project from the Telerik Project Wizard so to be sure there's no assemblies issues.

Note also that I'm using VS Community 2015 with Xamarin.Forms v2.3.3.180.

Kind regards,

Jacopo

0
Ivaylo Gergov
Telerik team
answered on 21 Feb 2017, 11:58 AM
Hi Jacopo,

I tried to replace the code in the Lance's app and everything works as expected. I checked your solution and it seems there's something wrong in the OnSizeAllocated method. I didn't have the time to analyze it but if I remove the method and just add the scroll as RadSideDrawer's content instead of the grid the control is vizualized properly.

Please, let me know if I can be of further help.

Regards,
Ivaylo Gergov
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
Jacopo
Top achievements
Rank 1
answered on 21 Feb 2017, 01:38 PM

Hi Ivaylo!

As a matter of fact, if you do add a scroll inside the RadSideDrawer everything works fine.

But if you put the scroll inside another control (e.g. a Layout, I tried with a Grid and an AbsoluteLayout) you get the UWP-displaying error (blank page). And that's what I'd need to do.

I can confirm you I integrated the code in Lance's app (setting the RadSideDrawer MainContent to "<Grid BackgroundColor="Green"><ScrollView><Label Text="Hello"/></ScrollView></Grid>") and nothing displays on UWP.

As for my test solution, I tried removing the OnSizeAllocated method and adding the Scroll as MainContent for the RadSideDrawer and that displayed ok. But when I set the MainContent as an AbsoluteLayout or a Grid (both containing the scroll I previously set as the MainContent) I get the blank page in UWP.

With Android everything keeps working just fine.

Am I doing something wrong?

Thanks once again,

Jacopo

0
Ivaylo Gergov
Telerik team
answered on 24 Feb 2017, 09:42 AM
Hi Jacopo,

I confirm, i modified the example to reproduce the issue. It seems this is a bug and I have logged it in our bug tracking system. For now, I cannot suggest a reasonable workaround.

Thank you for your valuable feedback. I have updated your Telerik points.


Regards,
Ivaylo Gergov
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
Jacopo
Top achievements
Rank 1
answered on 24 Feb 2017, 09:59 AM

Hi!

I'm glad my feedback helped finding out a bug.

Let me know as soon as there'll be a fix for this. And don't worry about a reasonable workaround, I'll figure an alternative out myself.

Kind regards,

Jacopo

Tags
SideDrawer
Asked by
Jacopo
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Jacopo
Top achievements
Rank 1
Ivaylo Gergov
Telerik team
Share this question
or