Telerik blogs

 

I’m happy to announce that with the Q1 2011 SP1 release RadTileView will have yet another new and amazing feature – selection. This will allow you to mark, group or highlight your TileViewItems with a single click. The TileView selection supports three modes:

  • Single – this is the default selection mode and it is the simplest one as well. In this mode you select/deselect an item by a single left mouse button click and you can’t have more that one selected item.
  • Multiple – this is similar to the Single mode, the only difference is that you can select more that one item.
  • Extended – this is the most complex and probably the most usable mode. With it we tried to create an Explorer-like selection i.e. in addition to the mouse selection you’ll have support for some keys like Ctrl, Shift, Tab, ArrowKey, Esc and combinations between them. The Mouse+Ctrl and Mouse+Shift combinations are pretty straightforward – with the first you Add/Remove a single item to the selected items, with the second you make a range selection from the currently selected item to the last clicked item. The Tab and Tab+Shift combinations are used for selecting the next or the previous item. The arrow keys are used to select the left, right, top or bottom item, if used with the shift they execute range selection. There’s also support for Ctrl+A – select all and Esc – unselect all.

You’ll be able to manage your selected items with the SelectedItem, SelectedIndex and SelectedItems properties. The SelectedItem and SelectedIndex properties indicate the currently selected item, if you have more than one selected items they usually show the first selected item. The SelectedItems collection holds all currently selected items and you can change the selection of an item by adding/removing item to this collection.

The RadTileView will expose four new events that are related to the selection:

  • PreviewTilesSelectionChanged – before any selection changes
  • PreviewTileSelectionChanged – before the selection of an item changes
  • TileSelectionChanged – after the selection of an item have changed
  • TilesSelectionChanged – after all selections have changed

Demo

I’ll show how to create a simple TileView with selection. All you have to do is enable the selection and set a selection mode:

<telerik:RadTileView x:Name="myTileView"
               IsSelectionEnabled="True"
               SelectedIndex="1"
               SelectionMode="Extended">
    <telerik:RadTileViewItem>1</telerik:RadTileViewItem>
    <telerik:RadTileViewItem>2</telerik:RadTileViewItem>
    <telerik:RadTileViewItem>3</telerik:RadTileViewItem>
    <telerik:RadTileViewItem>4</telerik:RadTileViewItem>
</telerik:RadTileView>

 

If you run the application you should see:

You can download the sample application from here.

And download a trial version of Telerik RadControls from here:

RadControls for Silverlight – Download Trial

RadControls for WPF – Download Trial


About the Author

Zarko Vidolov

is a .Net developer in Telerik XAML division. In his work he is mainly responsible for RadDiagram, RadTileView, RadBreadcrumb and RadPersistenceFramework development and implementation. Apart from work he enjoys reading and snowboarding.

Comments

Comments are disabled in preview mode.