Enable selection when change gridviewrow template

2 posts, 0 answers
  1. Thnghi
    Thnghi avatar
    9 posts
    Member since:
    Feb 2013

    Posted 01 Jul 2013 Link to this post

    Hi all,

    I change my gridviewrow template successfully but the gridview disable selection. I need  my gridview  can enable multi selection mode.
     I use
      <ControlTemplate x:Key="CustomRowTemplate"
                             TargetType="telerik:GridViewRow">
                <Border x:Name="rowsContainer"
                        Background="Transparent"
                        
    BorderThickness="0,0,0,1"
                        Padding="1">
                    <Grid Width="Auto"
     HorizontalAlignment="Stretch">

                        <Grid.RowDefinitions>
                            <RowDefinition Height="20" />
                            <RowDefinition Height="20" />
                            <RowDefinition Height="20" />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition MinWidth="150" Width="Auto" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Border Grid.Column="0"
    Grid.RowSpan="3"
    Grid.Row="0"
    VerticalAlignment="Center"
    HorizontalAlignment="Stretch"
    Height="60"
    Width="60"
    Margin="15,0"
    BorderThickness="1"
    CornerRadius="1"
    BorderBrush="Black">

                        </Border>

                        <TextBlock Text="Device Name: "
    Margin="5,0,0,0"
    FontWeight="Bold"
    Grid.Row="0"
    Grid.Column="1"
    VerticalAlignment="Center"
      HorizontalAlignment="Left" />
                        <TextBlock Text="{Binding UserName}"
      Margin="5,0,0,0"
      Grid.Row="0"
      Grid.Column="2"
      VerticalAlignment="Center"
      HorizontalAlignment="Left" />

                        <TextBlock Text="Source: "
      Margin="5,0,0,0"
      FontWeight="Bold"
      Grid.Row="1"
      Grid.Column="1"
      HorizontalAlignment="Left"
      VerticalAlignment="Center" />
                        <TextBlock Text="{Binding LastLoginDate}"
      Margin="5,0,0,0"
      Grid.Row="1"
      Grid.Column="2"
      VerticalAlignment="Center"
      HorizontalAlignment="Left" />

                    </Grid>
                </Border>
            </ControlTemplate>
            <Style TargetType="telerik:GridViewRow" >
                <Setter Property="Template" Value="{StaticResource CustomRowTemplate}" />
            </Style>

    to change gridivewrow template and this make my gridivew can not have selection function.

    If any one have experiences in this. Please help me, thanks

  2. Yoan
    Admin
    Yoan avatar
    1214 posts

    Posted 01 Jul 2013 Link to this post

    Hi,

    I can suggest you to copy the default style of GridViewRow and then modify it. Please check this help article which shows you the approach.

    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top