Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
Accessing CellValuePresenter Dynamically
posted

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?