Bind name of a RadTileViewItem

3 posts, 1 answers
  1. Deepak
    Deepak avatar
    8 posts
    Member since:
    Jul 2014

    Posted 14 Aug 2014 Link to this post

    I am using telerik RadTileView control. I had to create a template to stick it to ContentTemplate. This has a ItemSource bound to ObservableCollection.

    <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>
    <DataTemplate x:Key="TabItemTemplate">
            Some controls here
    <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">

    I am not able to understand as to how I can bind the name of the RadTileViewItem.
  2. Answer
    Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1251 posts

    Posted 19 Aug 2014 Link to this post

    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.

    Pavel R. Pavlov
    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.
  3. Deepak
    Deepak avatar
    8 posts
    Member since:
    Jul 2014

    Posted 19 Aug 2014 Link to this post

    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.

Back to Top