Hi,
We are evaluating 15.1. The CellBinding feature is a feature that we would really like to use, but I am running into an interesting issue. I have the following code. In the UI, the disabled cells show up gray and the enabled cells show up white, as expected. However, I'm still able to edit and change the value of the disabled cells. Is this a known issue, or am I doing something wrong?
<igdp:CurrencyField Name="Salary">
<igdp:CurrencyField.CellBindings>
<igdp:CellBinding Property="IsEnabled" Target="Editor" Binding="{Binding Path=DataItem.CanEditSalary}"/>
</igdp:CurrencyField.CellBindings>
</igdp:CurrencyField>
I'm pretty sure the binding is setup correctly, because as I noted, I do see the disabled cells being grayed out.
If I change the code as follows, all cells show up gray, as expected. However, this time I am not able to edit the cells, which is the behavior I would expect to see.
<igdp:CurrencyField Name="Salary" IsEnabled="False" />
I can attach a sample project that shows this issue if need be.
Hi Tory,
Currently I could not think of a reason why the CellBinding is not working as expected when the error template is defined. Would it be possible for you to share a sample project so I can investigate the behavior with your scenario? Thank you.
Hi Maria,
Thanks for helping us with this issue. I did a little more research, and have narrowed in on the issue. We have defined the following style, since we have a special way that we want cell errors to be displayed. If I remove this style, the issue does not reproduce.
Do you see anything I'm doing wrong? Is there a different way to change how cell errors get displayed without interfering with the functionality of the CellBindings feature?
<DataTemplate x:Key="{x:Static igdp:DataPresenterBase.DataErrorContentTemplateKey}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Border x:Name="errorBorder" BorderThickness="1" BorderBrush="DarkRed" Visibility="Collapsed" SnapsToDevicePixels="True"> <Border BorderThickness="1" BorderBrush="#FFFF9696" Background="#FFFFEBEB" SnapsToDevicePixels="True" /> </Border> <ContentPresenter x:Name="content" ContentTemplate="{x:Null}" Margin="0,0,2,0" /> </Grid> <DataTemplate.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding Path=Host.HasDataError}" Value="true" /> </MultiDataTrigger.Conditions> <Setter TargetName="errorBorder" Property="Visibility" Value="Visible" /> </MultiDataTrigger> </DataTemplate.Triggers> </DataTemplate>
Hello Tory,
I have put together a sample project trying to reproduce the behavior with version 15.1 using your code snippet and it seems that on my side the cells are not editable when the CanEditSalary is false. Would you please have a look at the project and let me know if I am missing something in your scenario? Please also note that CellBinding equals setting a CellValuePresenter’s property locally. This means that the triggers in the default style where IsEnables property is used will not be applied.