Styling the RadUploadItem

Before reading this topic, you might find it useful to get familiar with the Template Structure of the RadUploadItem control.

The RadUploadItems can be styled by creating an appropriate Style and setting it to the ItemContainerStyle property of the RadUpload.

You have two options:

  • To create an empty style and set it up on your own.

  • To copy the default style of the control and modify it.

This topic will show you how to perform the second one.

Modifying the Default Style

The RadUploadItem control is located in the Telerik.Windows.Controls namespace of the Telerik.Windows.Controls.Input assembly. In order to use it you have to declare it in XAML: xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" When working in Expression Blend, the namespaces that are needed will be added automatically.

Load your project in Expression Blend and open the User Control that holds the RadUpload. You have to use a dummy control in order to get the default style. To create one find the RadUploadItem control in the 'Assets' pane and draw one on the art board. In the 'Objects and Timeline' pane select the RadUploadItem that you've drawn and from the menu choose Object -> Edit Style -> Edit a Copy. You will be prompted for the name of the style and where to be placed.

If you define the style in the Application resources, it would be available for the entire application. This allows you to define a style only once and then reuse it where needed.

After clicking 'OK', Expression Blend will generate the default style of the RadUploadItem control in the Resources section of your User Control. The properties available for the style will be loaded in the 'Properties' pane and you will be able to modify their default values. You can also edit the generated XAML in the XAML View or in Visual Studio.

To apply the style to the real items, set it to the ItemContainerStyle property of the RadUpload.

Example 1: Setting the item style

<telerik:RadUpload x:Name="radUpload" 
                   ItemContainerStyle="{StaticResource RadUploadItemStyle}" /> 

Don't forget to delete the dummy RadUploadItem control, when you finish editing the style.

See Also

In this article