Click here to Skip to main content
15,034,865 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

XML
<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>
Posted
Updated 24-Nov-11 2:24am
v2

Event u can use is Checked/Unchecked. On that u can find parent row of that check box so after that u can perform action whatever u want.
   
11><
<big></big>
[]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900