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