Edit this page

Namespace Declaration

The following topic will show you how to manually declare a namespace in XAML.

Almost all Telerik controls can be found in a special URI namespace. 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 only few controls which are in another namespace. These are RadPivotGrid and RadPivotFieldList and their namespace is: xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot"

  • Create a new Silverlight Application.

  • Add references to the Telerik DLLs in the Solution Explorer.
    Common Installing Namespace Declaration 011

  • Open the MainPage.xaml.

  • Go to the UserControl tag and write:


Or you can select it from the IntelliSense in XAML.Common Installing Namespace Declaration 012
  • The result should be similar to this.

<UserControl x:Class="SilverlightApplication1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&#13;    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&#13;    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"&#13;    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"&#13;    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"&#13;    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 this namespace and which is in the assemblies you have added in your project. An example of RadTreeView declaration is shown below.

<UserControl x:Class="SilverlightApplication1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&#13;    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&#13;    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"&#13;    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"&#13;    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"&#13;    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadTreeView/>
    </Grid>
</UserControl>

If you wonder which control in which assembly belongs to, read the main topic about Controls Dependencies.

See Also

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy