CheckBox Select Row

2 posts, 0 answers
  1. GOURVEZ JJ
    GOURVEZ JJ avatar
    55 posts
    Member since:
    Dec 2009

    Posted 01 Mar 2012 Link to this post

    Hi,

    I use an radgridview to display data.
    In my RadGridView, I want an checkbox, permit to select row to have class

    But when I check (or unchecked), I can't have my class

    This is my code :

    XAML :

    <

     

     

    telerik:GridViewDataColumn DataMemberBinding="{Binding isSelect}" HeaderCellStyle="{StaticResource MyHeaderCellStyleBlue}" Width="41">

     

     

     

     

    <telerik:GridViewDataColumn.Header>

     

     

     

     

    <sdk:Label Content="Select" ToolTipService.ToolTip="Select" ></sdk:Label>

     

     

     

     

    </telerik:GridViewDataColumn.Header>

     

     

     

     

    <telerik:GridViewDataColumn.CellTemplate>

     

     

     

     

    <DataTemplate>

     

     

     

     

    <CheckBox IsChecked="{Binding isSelect, Mode=TwoWay}" HorizontalAlignment="Center" Checked="checkIsSelect" Unchecked="unchekIsSelect"/>

     

     

     

     

    </DataTemplate>

     

     

     

     

    </telerik:GridViewDataColumn.CellTemplate>

     

     

     

     

    </telerik:GridViewDataColumn>

     



    C# :

     

     

    private void checkIsSelect(object sender, RoutedEventArgs e)

     

    {

     

     

     

    Ligne ligne = (Ligne)radgridview1.SelectedItem;

     

     

     

    if (ligne != null) // the class is always null when I check

     

    {

    MessageBox.Show(ligne.name);
    }

    }



    Can you help me ?

    Thanks
  2. GOURVEZ JJ
    GOURVEZ JJ avatar
    55 posts
    Member since:
    Dec 2009

    Posted 02 Mar 2012 Link to this post

    I find,

    the problem is checked and unchecked event.

    I use now click event and it works
Back to Top