Hello,I have a multi-band grid formed by two calsses, parent and child.The parent class has a property which is a reference to the child, correctly showing up as a child band in the grid.
The child class has also a reference to the parent class, but with the browsable attribute set to false, this is successfully not shown neither as a column nor as a band. However, I'm getting a column called "Parent", which I'm assuming the grid is automatically inserting for me. This column doesn't even show in the columns collection, and of course the cell text only displays the name of the parent class. Curious enough, this column is also successfully using the [DisplayName] attribute defined in the Parent class.Summing up:[DisplayName("ParentDisplayName")public class Parent { [Browsable(true)] IEnumerable<Child> Childs {get;}} public class Child{
[Browsable(false)] Parent Parent {get;}
} The child band is displaying a column called "ParentDisplayName" which doesn't even show up in the Columns list for the band.Any ideas on how to hide this column? Ideally without having to manually hide it like Columns("ParentDisplayName").Visible = false;Thanks!
I'm sorry, apparently the problem is precisely that the grid is not respecting the [Browsable(false)] attribute for any of the child band's properties. It does however respects the DisplayName attribute. Any ideas?
Hi Federico,
I tried this out in a small sample, and I was not able to reproduce the behavior you described. In my sample, I do not see the Parent property as expected.
Please modify the attached sample so that it accurately reflects your application scenario.
Hello Mike,Thanks a lot for your answer. I was able to replicate my issue with a small adjustment to your sample.First of all, the Parent property of the Child class was not public, that's why it wasn't showing.Furthermore, the columns don't show by default, but do show up in the column chooser, I believe by having the Browsable(false) attribute they shouldn't show there either, as it happens with the Parent class I added ChildValueBrowsable, ChildValueNotBrowsable, ParentValueBrowsable and ParentValueNotBrowsable properties. As you can see, for the child we see all properties, including the not browsable ones, and for the parent we correctly only see the browsable properties.I'm not sure how to attach a file so I pasted the code for Form1.cs here. It will work from your sample just replacing Form1.cs.Thanks,Federico.
When I grabbed your code and added it to my sample, I observed that the grid respected the value of the Browsable attribute. I attached an image of what I see.
What version of our tool are you using? It's possible that there was a bug in an older version that we've sinced fixed.