I have a xam grid with unbound field whose CellValuePreseneterStyle is set and where I am setting the Template Property of CellValuePresenter to some control say XAMMaskedEditor. On Click of this cell, CellClickAction is not working and SelectedItemsChanged is not firing eve. Could you please help!
Hello Gowri,
If you set the editor in the field to only be enabled when the field is active it will respect the SelectCell CellClickAction. For example:
<Style x:Key="cellStyle2" TargetType="{x:Type igWPF:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igWPF:CellValuePresenter}">
<igEditors:XamMaskedEditor x:Name="editor" Value="{Binding DataItem.ID}" Background="AliceBlue" IsEnabled="False"/>
<ControlTemplate.Triggers>
<Trigger Property="IsActive" Value="true">
<Setter TargetName="editor" Property="IsEnabled" Value="True"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Please let me know if you have any questions.
Sincerely,
Valerie
Software Developer
Infragistics Inc
Hi Valerie
Thanks for the response. But we use version 12.1 and could not upgrade right now. Could you please suggest any workaround. Or is there any way where we can differentiate whether the field is editable or not in mouse left button click event?
In 14.2 we introduced template fields for the XamDataGrid. I suggest you use a template field as opposed to setting the control template on the CellValuePresenterStyle as this will allow you to easily maintain a lot of the functionality contained in the CellValuePresenter’s default control template. Using a template field allows you to set both a display template and an edit template and will respect the CellClickAction. To learn more about template fields please see http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=xamDataPresenter_Configuring_Template_Field.html.
Let me know if you have any questions.