Click here to Skip to main content
14,635,966 members
Rate this:
Please Sign up or sign in to vote.
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.

<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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

11><
<big></big>
[]
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100