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
Piotr Sidor
NA
27
863
How to get access to gruop style element in datagrid.
Jul 30 2019 6:31 AM
I have implement datagrid as below and i have no idea how to with checkbox named SelectGroupCheckBox check all checkbox in gruop.
<DataGrid x:Name=
"PersonDataGrid"
HorizontalAlignment=
"Left"
VerticalAlignment=
"Top"
Height=
"450"
Width=
"902"
CanUserAddRows=
"False"
AutoGenerateColumns=
"False"
>
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType=
"{x:Type GroupItem}"
>
<Setter Property=
"Template"
>
<Setter.Value>
<ControlTemplate TargetType=
"{x:Type GroupItem}"
>
<Expander IsExpanded=
"False"
>
<Expander.Header>
<StackPanel Orientation=
"Horizontal"
>
<CheckBox x:Name=
"SelectGroupCheckBox"
>
</CheckBox>
<TextBlock Text=
"{Binding Name}"
/>
</StackPanel>
</Expander.Header>
<Expander.Content>
<ItemsPresenter/>
</Expander.Content>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<CheckBox Content=
"Select All"
Checked=
"CheckBox_Checked"
Unchecked=
"CheckBox_Unchecked"
/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding=
"{Binding Person.Name}"
Header=
"Name"
Width=
"120"
IsReadOnly=
"True"
/>
</DataGrid.Columns>
</DataGrid>
Reply
Answers (
1
)
Why to implement ICommand interface?
Is MVVM Pattern included in any of the .Ney Library?