My xamdatagrid has seperate styles for row selection and cell selection.
When a checkbox is placed inside the unbound field of xamdatagrid,
1) the default row selection style is applied to the entire row along with the cells containing the checkbox (viz. can see the style --> color in the cell area which surrounds the checkbox) --> working fine!
2) but cell selection style could'nt be applyed (viz. when i click on the cell which contains the checkbox, i cannot see the style --> color change for that particular cell as in other unbound fields which do not contain the control template) --> not working
The code is,
<igDP:UnboundField Width="50"
Height="25"
Binding="{Binding Enablebelow,Mode=TwoWay}" >
<igDP:UnboundField.Settings>
<igDP:FieldSettings CellClickAction="SelectCell" >
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter }">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<Grid height=”15”
Width = “15”>
<igEdit:XamCheckEditor MouseLeftButtonDown="XamCheckEditor_MouseLeftButtonDown" IsChecked="{Binding Path=DataItem.Enablebelow,Mode=TwoWay}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
Hello Gowsikhaa,
Thank you for your post. I have been looking into it and I can suggest you set the CellValuePresenter’s ContentTemplate instead of its Tempalte, so you could be able to use the default functionality. You can modify your Style like this:
<Style TargetType="{x:Type igDP:CellValuePresenter }"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <Grid height="15" Width = "15"> <igEdit:XamCheckEditor MouseLeftButtonDown="XamCheckEditor_MouseLeftButtonDown" IsChecked="{Binding Path=DataItem.Enablebelow,Mode=TwoWay}" /> </Grid> </DataTemplate> </Setter.Value> </Setter> </Style>
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Hi,
I tried it with 'datatemplate' as suggested. It worked!. Now, the default styles can be applyed without any difficulty. Thank You..