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:
So if there is another way to determine which columns satisfy this, I'd be happy with that also.
Hi Ronith,
This is the WinGrid forum, not WebGrid. So you should re-post your question in the appropriate WebGrid forum.
[Browsable(false)] does not work for UltraWebGrid.
What option do we have for web grid?
Regards,
Ronith
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.