Namespace Declaration
The following topic will show you how to manually declare a namespace in XAML.
Almost all Telerik controls can be found in the 'telerik' URI namespace schema (see Example 1). You can use only this namespace to access all controls from Telerik assemblies that you are referring in your application. You cannot access controls from assemblies that you are not referring.
There are few controls which are in another namespace. For example, such are RadPivotGrid and RadPivotFieldList and their namespace is: xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot".
Create a new Application.
-
Add references to the Telerik DLLs in the Solution Explorer.
Open the MainPage.xaml.
-
Go to the UserControl tag and add the following namespace.
Example 1: Telerik namespace definition
Or select it from the IntelliSense in XAML.xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
-
The result should be similar to this.
Example 2: Telerik namespace added in XAML
<UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> </Grid> </UserControl>
-
Now you should be able to declare any controls - existing in the Telerik namespace - which are included in the assemblies you have added to the project. An example of RadTreeView declaration is shown below.
Example 3: Using the Telerik namespace
<UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <telerik:RadTreeView/> </Grid> </UserControl>
See the Telerik assemblies required by each control in the Controls Dependencies article.