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
985
Hiding a list column from the grid
posted

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? 

XamDataGridComboCellModified2.zip
Parents
No Data
Reply
  • 985
    posted

    Hello,

    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.

Children