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,
You are welcome. If you have any other questions, please feel free to update the thread.
Hi Maria,
You can consider this issue closed. We have decided not to pursue using CellBinding to the IsEnabled property, as it caused a number of UI display related issues (for example, not being able to control the disabled foreground/background colors of the cell) that we were not able to workaround.
However, I did make the change you suggested to the ContentPresenter in our DataErrorContentTemplateKey style, so that we are in-sync with the latest changes.
Many thanks for your help!
Hello Tory,
I am just checking if you had a chance to look into this and if you would like any further assistance on the matter.
I have spent more time on this and on the DataErrorContentTemplateKey template that you have mentioned. I have noticed that the DataContext binding is missing for the ContentPresenter as well as the ContentTemplate binding which is set to null. This seems to be the approach a while ago and since then a couple of changes were applied and the ContentPresenter definition looks like this: <ContentPresenter x:Name="content" ContentTemplate="{Binding Path=Content.Host.ContentTemplate, RelativeSource={x:Static RelativeSource.Self}}" DataContext="{Binding Path=Content.Host.DataContext, RelativeSource={x:Static RelativeSource.Self}}" Margin="0,0,2,0" />In the current context you need to set only the DataContext property so you can bind to DataItem’s property without any error thrown in the Output window. I would also suggest you to keep the ContentTemplate binding as it will allows any ContentTemplate that a custom CellValuePresenter style is setting to be used.Feel free to let me know if I could assist you further on this.
I've attached a sample app. You may need to update the references to point to the 15.1 Infragistics DLL. When you run the app, pay special attention to the Salary, EmpName, Age, and *** columns for the 2nd and 4th rows. Those cells are marked as non-editable, but the app lets you edit them anyway. Note you will need to double clicking to enter edit mode, since we have CellClickAction set to SelectCell.