Hi,
i have Xamdatagrid with 4 different fieldlayout. i am binding heirarchical data to the grid. i have common header for all fieldlayout.
when i expand first record then it will do visible one or two column and if i collapse that record then it will also hide that columns.
i want to check if any other records whhich are alreday expanded to nested level then it will not hide that column.
Regards,
Ripal
Hello Ripal,
Each DataRecord that exists in the XamDataGrid.Records collection has a ChildRecords collection property on it which returns a collection of ExpandableFieldRecord objects. Each of these ExpandableFieldRecords has a ViewableChildRecords property, which returns the collection of DataRecords that make up the child band, and so the hierarchy goes on that way. It appears that you may have noticed that your child records have DataRecord.NestingDepth = 0,2,4,6,8 in that sequence. This is because the ExpandableFieldRecord has the odd-numbered nesting depth.
You can retrieve each of the records at a specific nested depth by looping through each ExpandableFieldRecord's VisibleChildRecords. If you start at the top-level of your grid and recursively loop through each of the children, you can fill an external collection with the list of child records at a particular nested depth. I have attached a sample project to demonstrate this recursive method. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hi andrew,
can you please help me to get the records with nesting depth = n when n could be 2,4,6,8 .
Thank you for your post.
It is the expected behavior of the XamDataGrid that when you expand a record, you will see the fields that exist in the child bands and when you collapse that record, you will hide those columns that exist in the child band, but I am a bit unsure of the functionality that you are looking to achieve, as I'm not sure what you mean by "I want to check if any other records which are already expanded to nested level then it will not hide that column." Would it be possible for you to please provide some more detail on what is meant by this?