New to Telerik UI for Xamarin? Download free 30-day trial

Getting Started

This article will guide you through the steps needed to add a basic RadDockLayout control in your application.

1. Setting up the app

Take a look at these articles and follow the instructions to setup your app:

2. Adding the required Telerik references

You have two options:

If you don't want to add the all Telerik.UI.for.Xamarin nuget package, you have the option to add a separate nuget package. For RadDockLayout control you have to install the Telerik.UI.for.Xamarin.Common nuget package.

  • Add the references to Telerik assemblies manually, check the list below with the required assemblies for RadDockLayout component:
Platform Assemblies
Portable Telerik.XamarinForms.Common.dll
Android Telerik.Xamarin.Android.Common.dll
iOS Telerik.Xamarin.iOS.dll
UWP Telerik.XamarinForms.Common.dll

3. Adding RadDockLayout control

You could use one of the following approaches:

Drag the control from the Toolbox.

Take a look at the following topics on how to use the toolbox:

Create the control definition in XAML or C#.

The snippet below shows a simple RadDockLayout definition:

<telerikCommon:RadDockLayout x:Name="dockLayout">
    <Grid HeightRequest="60"
        <Label Margin="20" Text="Title"/>
    <Grid HeightRequest="60"
        <Label Margin="20" Text="Navigation" />
    <Grid WidthRequest="120"
        <Label Margin="20" Text="Bottom" />
    <Grid HeightRequest="60" 
        <Label Margin="20" Text="Content" />
var dockLayout = new RadDockLayout();

var topGrid = new Grid { HeightRequest = 60, BackgroundColor = Color.FromHex("009688")};
topGrid.Children.Add(new Label { Margin = 20, Text = "Title" });
topGrid.SetValue(RadDockLayout.DockProperty, Dock.Top);

var leftGrid = new Grid { HeightRequest = 60, BackgroundColor = Color.FromHex("659BFC")};
leftGrid.Children.Add(new Label { Margin = 20, Text = "Navigation" });
leftGrid.SetValue(RadDockLayout.DockProperty, Dock.Left);

var bottomGrid = new Grid { WidthRequest = 120, BackgroundColor = Color.FromHex("1455C9")};
bottomGrid.Children.Add(new Label { Margin = 20, Text = "Bottom" });
bottomGrid.SetValue(RadDockLayout.DockProperty, Dock.Bottom);

var lastGrid = new Grid { HeightRequest = 60, BackgroundColor = Color.FromHex("FCCFB0")};
lastGrid.Children.Add(new Label { Margin = 20, Text = "Content" });

In addition to this, you need to add the following namespace:

using Telerik.XamarinForms.Common;

This is the result:


SDK Browser and QSF applications contain different examples that show RadDockLayout's main features. You can find the applications in the Examples and QSF folders of your local Telerik UI for Xamarin installation.

See Also

In this article