TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ganesh Gurav
NA
87
32k
uncheck Select All chkbox if any one of chkbox is unchecked
Oct 19 2016 1:30 AM
I have a checkbox named
chkSelectAll
which placed in header. When I click this then all other check boxes inside my DataGrid is Checked. But I want when anyone of the checkbox inside the grid will be unchecked then this
chkSelectAll
Checkbox will automatically uncheck.
<DataGridTemplateColumn> Please check below code .
<DataGridTemplateColumn.Header>
<CheckBox x:Name="chkSelectAll" Content="Select All" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox Name="chkCellTemp" Margin="45 2 0 0">
<CheckBox.Style>
<Style TargetType="{x:Type CheckBox}">
<Setter Property="IsChecked" Value="False" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=chkSelectAll, Mode=TwoWay}" Value="True">
<Setter Property="IsChecked" Value="True"/>
</DataTrigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
</CheckBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Reply
Answers (
4
)
wpf grdiview select all notworking
how to get selected rows of datagrid in wpf?