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

Enable selection when change gridviewrow template

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thnghi
Top achievements
Rank 1
Thnghi asked on 01 Jul 2013, 05:12 AM
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

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 01 Jul 2013, 12:11 PM
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 >>
Tags
GridView
Asked by
Thnghi
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or