Hi,
I have requirement where i need apply the security and make the forms as readonly.I writing a generic
logic for all our screens.I am using VisualTreeHelper in the base class to iterate all the control and make
IsReadOnly if possible otherwise IsEnabled=false. For the XamDataGrid i am able to set the FieldSettting
AllowEdit and it works fine. The problem is with the Custom CellValuePresenter.I am accessing the
CellValuePresenter in the XamDataGrid Loaded event and search all the control inside in it using VisualTreeHelper
and applying a binding to IsReadOnlyProperty or IsEnabledProperty.It finds the control and applys the binding
but still the user can edit the control.
Could you please suggest me the best way for dealing with CellValuePresenter?
Please Can someone reply for this.
So this works for all the other CellValuePresenters except the custom one? You should be setting IsEnabled/IsReadOnly to the editor in that cellvaluepresenter. If that is not working, you can try canceling the EditModeStarting event. Actually, you can do this for all the cellvaluepresenters, instead of iterating through all of them.