sreekanth v

sreekanth v

  • NA
  • 51
  • 0

Checkbox in WPF

Nov 24 2011 8:44 AM
I have a datagrid i have a column isworking. i want to place checkbox in datagrid template. I placed it but its not working. dynamically when i check or uncheck checkbox in datagrid template that row should be hide. where i should write the code what event i have to use. please help me
thank you.
here code.
 
Collapse | Copy Code
<DataGrid AutoGenerateColumns="False" Name="gv"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding Path=Empid}" Header="empid"/> <DataGridTextColumn Binding="{Binding Path=empname}" Header="ename"/> <DataGridTextColumn Binding="{Binding Path=deptid}" Header="Age"/> <DataGridTextColumn Binding="{Binding Path=salary}" Header="Employee Number"/> <DataGridTextColumn Binding="{Binding Path=joiningdate}" Header="JoiningDate"/> <DataGridTemplateColumn Header="Isworking"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <CheckBox Name="chk" Content="{Binding Path=isworking}" IsChecked="False" IsThreeState="False"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid>

Answers (1)