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

Bind name of a RadTileViewItem

2 Answers 43 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 14 Aug 2014, 04:22 PM
I am using telerik RadTileView control. I had to create a template to stick it to ContentTemplate. This has a ItemSource bound to ObservableCollection.

<Window.Resources>
<DataTemplate x:Key="tileHeaderTemplate">
    <StackPanel Orientation="Horizontal">
        <TextBlock HorizontalAlignment="Center" Text="{Binding Name}"></TextBlock>
        <Button x:Name="btnCloseTileItem" HorizontalAlignment="Right" Content="X" Click="btnCloseTileItem_Click"></Button>
    </StackPanel>
</DataTemplate>
<DataTemplate x:Key="TabItemTemplate">
    <Grid>
        ......
        Some controls here
    </Grid>
</DataTemplate>
 
</Window.Resources>
 
<telerik:RadTileView x:Name="SelectedTablesTile" ColumnsCount="3" ColumnWidth="*" ItemTemplate="{StaticResource tileHeaderTemplate}" ItemsSource="{Binding FinalTablesCollection}" ContentTemplate="{StaticResource TabItemTemplate}" IsAutoScrollingEnabled="True" IsDockingEnabled="True" IsVirtualizing="True" MinimizedColumnWidth="150" MinimizedRowHeight="150" PreservePositionWhenMaximized="True" RowHeight="150" TileStateChangeTrigger="SingleClick" AllowDrop="False" Grid.Row="0">
</telerik:RadTileView>


I am not able to understand as to how I can bind the name of the RadTileViewItem.

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 19 Aug 2014, 08:33 AM
Hi Deepak,

Basically in MVVM scenarios the x:Name attribute of the UI elements are not used. Could you please provide us with more detailed information about your requirements? This will help us to better understand why you need to use that attribute. Once we do so we will be able to suggest a better approach in your particular scenario.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Deepak
Top achievements
Rank 1
answered on 19 Aug 2014, 04:37 PM
Hi Pavel,

You are absolutely right. Realised it.. Change my logic and as you said there is no need for me to set the name. 
Thanks for putting me in right direction.

Cheers,
Deepak
Tags
TileView
Asked by
Deepak
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Deepak
Top achievements
Rank 1
Share this question
or