Add reference
xmlns:dataprimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
Add Column into silverlight data grid
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn Width="20">
<sdk:DataGridTemplateColumn.HeaderStyle >
<Style TargetType = "dataprimitives:DataGridColumnHeader">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<CheckBox x:Name="chkAll" IsChecked="{Binding Path=VMVPO.IsSelectAll, Mode=TwoWay}" Grid.Column="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction Command="{Binding SelectAll, Source={StaticResource dd}}" CommandParameter="{Binding ElementName=chkAll}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</CheckBox>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</sdk:DataGridTemplateColumn.HeaderStyle>
<sdk:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<CheckBox Name="chkSelect" IsChecked="{Binding Path=IsEnabled, Mode=TwoWay}"/>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
No comments:
Post a Comment