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

CheckBox Select Row

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
GOURVEZ JJ
Top achievements
Rank 1
GOURVEZ JJ asked on 01 Mar 2012, 09:46 AM
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

1 Answer, 1 is accepted

Sort by
0
GOURVEZ JJ
Top achievements
Rank 1
answered on 02 Mar 2012, 04:12 PM
I find,

the problem is checked and unchecked event.

I use now click event and it works
Tags
GridView
Asked by
GOURVEZ JJ
Top achievements
Rank 1
Answers by
GOURVEZ JJ
Top achievements
Rank 1
Share this question
or