Hello,
Hope you are well.
I am facing a number of issues while trying to hide a list column (property) from the grid. When you run the application attached, you will find that each row is expandable. Once you expand top level row, a header for subrows will appear called 'Persons'. Now you have to expand 'Persons' again to get the list of child rows!
Try opening the source file Person.cs, and now comment out the following:
private List<string> mAnimals = new List<string>();
[Browsable(false)] public List<string> Animals { get { return mAnimals; } set { mAnimals = value; } }
Once you you comment out the non-Browsable public list 'Animals' or change its access modifier from 'public' to 'private', and run the application again, you can expand each row and display its subrows in one step. The subrows' header 'Persons' won't be appearing this time. In my case, I am trying to achieve this output without removing the list property or changing its access modifier from 'public' to something else. I am also facing other behavioural issues while having two public lists, though the browsable property of one of them is set to false.
Please help me, how can I eliminate the extra expandable header displayed each time you expand a top level row?
Another issue I am facing only while having two public lists in the Class Person, is that the expansion indicator doesn't get updated. If I add or remove children (Persons) to a Person object, the expansion indicator status doesn't update instantly, unless you click on the row. I don't face this issue while having only one public list in the Class Person. While having only one public list, whenever I remove all the children (Persons) from a Person object, the expansion indicator is hidden, and once I add a new child, the expansion indicator shows again. Please help me, how can I rectify these issues while having two public lists, and one of them is non-browsable.
Thank you.
Hello Sherif,
Thank you for your post. I have been looking into it and I modified the sample you have attached, so now it works as you want. Basically I created a Style for the ExpandableFieldRecordPresenter and added EventSetter for the Loaded event. In the handler I set its Height to 0 and its IsExpanded to true. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.