This is a migrated thread and some comments may be shown as answers.

Binding IsSelected Property for Tile in MVVM

3 Answers 42 Views
TileList
This is a migrated thread and some comments may be shown as answers.
sandeep
Top achievements
Rank 1
sandeep asked on 04 Feb 2016, 06:22 AM

Hi, 

 Is there an option of binding IsSelected Property for the Tile In MVVM for each of the item in list that is binded to RadTileList Control/

I am using Autogenerating tiles for the RadTileList Control.

 

Thanks,

Sandeep Kumar Vidiyala

3 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 04 Feb 2016, 11:49 AM
Hi Sandeep,

You can bind the IsSelected property of the tile directly in the event as follows:
private void OnAutoGeneratingTile(object sender, AutoGeneratingTileEventArgs e)
        {
            e.Tile.SetBinding(Tile.IsSelectedProperty, new Binding("IsSelected"){Mode = BindingMode.TwoWay});
        }

Attached is a small sample project illustrating the behavior.

Regards,
Maya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
sandeep
Top achievements
Rank 1
answered on 04 Feb 2016, 12:09 PM

Hi Maya,

 

Thanks for your reply. 

Is this the only way or is there any option for binding in xaml.

 

Thanks,

Sandeep Kumar Vidiyala

 

0
Maya
Telerik team
answered on 04 Feb 2016, 12:14 PM
Hello Sandeep,

You can create a simple style as this one:
<Style TargetType="telerik:Tile">
            <Setter Property="IsSelected" Value="{Binding IsSelected}" />
        </Style>

If you are working with NoXaml binaries, don't forget to set BasedOn property.

Regards,
Maya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TileList
Asked by
sandeep
Top achievements
Rank 1
Answers by
Maya
Telerik team
sandeep
Top achievements
Rank 1
Share this question
or