thank you.
here code.
Collapse | Copy Code
Collapse | Copy CodeKnow the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Nov 28, 2011, 4:30 AM
STYLE
<Style x:Key="ChkCellStyle1" TargetType="{x:Type dg:DataGridCell}">
<Style.Triggers>
<Trigger Property="dg:DataGridCell.IsSelected" Value="True">
<Setter Property="BorderThickness" Value="0" />
Trigger>
Style.Triggers>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dg:DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
FocusVisualStyle="{x:Null}"
>
ContentPresenter>
Grid>
ControlTemplate>
Setter.Value>
Setter>
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridCell_PreviewMouseLeftButtonDown" />
Style>
CHECKBOX EVENT
<dg:DataGridCheckBoxColumn
x:Name="CellCompleted"
CellStyle="{StaticResource ChkCellStyle1}"
Width="150"
Binding="{Binding CB_Complete, Mode=TwoWay}"
IsReadOnly="True"
HeaderStyle="{StaticResource ColumnHeaderStyle}">
<dg:DataGridCheckBoxColumn.Header>
<TextBlock x:Name="Completed"/>
dg:DataGridCheckBoxColumn.Header>
dg:DataGridCheckBoxColumn>
Hope this helps.....
With Regards
P.Krishna Prasad