Dear all,
I am displaying a hierarchical DataGrid that displays Product and Product Details.
As a product might have dozens of product details, the user will scroll-down. By doing so, the parent row dispappears from the view. My user would like to always see the parent row while scrolling the product details.
How can I achieve this ?
I had a look to the feature that pin the parent row but this is not ideal to achieve the desired result.
Thank you for your help.
Hello Simon,
You can achieve this functionality - always display parent row while scrolling child rows if you use the IsFixed property of the record. Following user interactions you can use several events (e.g. RecordExpanding) in which you can set the fixed rows.
This implementation will depend on your scenario. For example, if you want to keep the current order of records, you will have to, also fix all the records before it.After the user collapses a record you can clear all the records which are fixed.
Note that if you fix multiple records to the top, the second parent you expand will become scrollable, so in this case you will need to collapse all other, but keep the previous fixed. To illustrate all of this I have prepared a sample application, please find it as an attached file.
You can also find more About Fixed (Non-Scrolling) Records in this Topic.
Hello,
Thank you very much for your help. I tried the solution you provided and noticed the following issues when adding more data to the grid :
First I have added more products to your sample so that I cannot see the whole list of products with the standard window size.
Then I have tried to expand/collapse records :
When collapsing a record, I still get one record fixed.
When I scroll down to a product (that I cannot see without scrolling) and expand it, then I get to the top of the grid and scrolling down doesn't work anymore.
I am using version 15.2.20152.2100.
Do you see any way to improve this behaviour ?
Thank you for your feedback.
I followed the steps you described and this actually is the expected behavior with fixed records. Since multiple records has been fixed, they all become non-scrolling.
If it is applicable to your scenario, you can consider fixing only the record that has been expanded. It will be fixed on top, the XamDataGrid will scroll to it and when you collapse it, the fix will be removed and the record will return in its place.
I have modified the previous sample, please find it as an attached file.