property.IsReadOnly = true; -> Not working

Forum Forums Visual Components 4.1 .NET Addon Programming property.IsReadOnly = true; -> Not working

This topic contains 2 replies, has 2 voices, and was last updated by Avatar Captain_Feature 1 week, 6 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16739
    Avatar
    Captain_Feature
    Participant

    Hy,

    i want to set the IsReadOnly-State of the component.Name-Property to true. I successfully call it but nothing happens?!

    Can someone help me with this?

    Thank you & Regards

    #16781
    Jay
    Jay
    Moderator

    On the current 4.1.* release, I suspect that most of the flags on IProperty actually does not work. Some flags on IComponentProperty do work (i.e IsEditableWhen… flags). For example if you want to make your property read only, you should do the following.

    var prop = comp.CreateProperty(typeof(string), PropertyConstraintType.AllValuesAllowed, “my_prop”);

    var compProperty = (IComponentProperty)prop;
    compProperty.IsEditableWhenDisconnected = false;

    Hope that helps.

    #16782
    Avatar
    Captain_Feature
    Participant

    Works perfect! Thx 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.