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
4028
Determine System.ComponentModel.Bindable property value of ultragrid column
posted

I am binding strongly typed objects to ultragrids in my winforms application, making use of the System.ComponnetModel.Bindable property of the object properties to help control which object properties are visible in the grids and which arnt.

Now I need to determine programatically which columns in a given grid have this property set to no, and which dont. How do I go about this?

Thanks.

---- EDIT ---

Just a little extra. What my goal is, is to determine which columns can potentially be viewed by the end user. That is:

  • The Bindable attribute is true.
  • AND
  • The field is not hidden   OR   the field is not excluded from the column chooser.

So if there is another way to determine which columns satisfy this, I'd be happy with that also.

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    It sounds like what you want to do here is define, at the class level, which fields are exposed to data binding. That makes sense, but the Bindable attribute won't have any effect on the kind of binding you are doing here. I tested this out in a simple sample using both UltraGrid and the DataGridView and the Bindable attribute has no effect. I'm pretty sure that Bindable refers to simple binding - that is, binding a control to a property of a field. So this would have an effect on Binding a field to a TextBox or some other single-value control. But it does nothing with more complex binding like when you bind to a list or a column in the grid.

    Anyway, if you want to hide a field from the BindingManager in DotNet, then the thing to do is use the Browsable attribute.

    [Browsable(false)]

    This will hide the property from the BindingManager in DotNet and it won't display in UtraGrid or the DataGridView.

Reply Children
No Data