TileView as button

2 posts, 0 answers
  1. Elgan
    Elgan avatar
    9 posts
    Member since:
    Nov 2012

    Posted 18 Nov 2012 Link to this post

    I have a template for a tileview content which is application wide.  so not using direct event.

    I have this;

    <telerik:RadFluidContentControl.Content  >
                         <Grid Margin="10 10">
                                 <TextBlock Margin="0 0 0 5"
                                        FontFamily="Segoe UI"
                                        Text="Last Appointment" />
                                 <TextBlock FontSize="14"
                                        Text="{Binding LastDate}" />
                                 <Border Height="2"
                                     Margin="0 5"  />
                                 <TextBlock Margin="0 0 0 5"
                                        FontFamily="Segoe UI"
                                        Text="Next Due" />
                                 <TextBlock FontSize="14"
                                        Text="{Binding NextDate}" />
                             <Button Tag="{Binding ListID}"
                                     Command="{Binding Path=TileClicked}"
                                     CommandTarget="{Binding TileClicked, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ElgEquineManager:HorsesPage}}}"></Button>

    I am trying to add a button to the tileview to cover the whole tile, so it can be clicked and made selected , and not just clicking on the header. make sense?

    I had an Click="" event before, but now I want this as a app wide template, any ideas?

  2. Kiril Vandov
    Kiril Vandov avatar
    324 posts

    Posted 21 Nov 2012 Link to this post

    Hi Elgan,

    I am not sure that I fully understand what exactly you want to accomplish. Do you want to select the tile item by clicking on it or you want to move from one state to another for example from minimized to maximized? I will be pleased if you could provide us with more details if possible.

    However, to select a tile you could use the IsSelectionEnabled property of RadTileView. That will allow you to select the tile by pressing anywhere in it.
    <telerik:RadTileView IsSelectionEnabled="True">

     If you want to change states (for example from minimized to maximized) we have a command that allows you to do that. Below is a code snippet with Button covering the whole TileViewItem which changes the state when clicked:
        <telerik:RadButton Content="Button" Command="tileView:TileViewCommands.ToggleTileState" />

    You are going to need following namespace in order to use the toggle state command:

    If there is any more questions don't hesitate to contact us.

    Kiril Vandov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top