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
60
Set value for AllowEdit property at runtime in code-behind
posted

How do I set the value for "AllowEdit" property at the run time in the code behind (xaml.cs).

I tried using AllowEdit="{Binding Path=IsAllowed}" where IsAllowed is the property I am setting in the Code behind. But it does not work.

Parents
No Data
Reply
  • 9694
    posted

    I apologize that no one has yet answered this post. We were inundated with more posts than we had resources to cover. Since that time we have been adding people to the task of making sure every post gets a reply from an Infragistics employee.

    To bind to a property called IsAllowed in your data, you could do the following:

    Binding binding = new Binding()
    {
        Source = checkBox,
        Path = new PropertyPath(CheckBox.IsCheckedProperty),
        FallbackValue = false,
        Mode = BindingMode.TwoWay,
        UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
    };
    BindingOperations.SetBinding(Grid.FieldSettings, FieldSettings.AllowEditProperty, binding);

Children
No Data