I have data displayed in a hierarchical fashion with a parent row that shows summarized data and the child rows are the detail data. Each child consists of two records that appear as a single record through the use of cell merging. I do not ever want the second detail record to be selectable. I have been intercepting the SelectedRowsCollectionChanged event to prevent the second detail row in the merged row from being selected. It works most of the time but it would be easier if I could just make a row not selectable.
One of the problems I am encountering is the ParentRow property of the detail data row points to a ColumnLayoutHeaderRow and not the summarized data row which is really the parent of these child rows. From the detail row, how do I access the summarized data row and not the ColumnLayoutHeaderRow? I believe a Parent Row of a child band row should not be the header row of the child band but the actual parent data row?
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that if you attach a sample project or post your code other community members may benefit from it as well.
Thanks again.
Thank you for taking the time to look at this. That was my first solution as well but the ParentRow property is not available off the ColumnLayoutHeaderRow. At least not from the immediate window where I tried to acces it. I was going to walk up the chain of parented records as you suggest but determined this property was not available and I did not have a method to get to the true parent record.
In my case I am going to create a template column, this is how I should have handled it in the first place. I am creating a time transfer UI and have From and To information that gets too long in a single row unless I stack the information so I was using two separate rows and cell merging to make them appear as one when I should just build a TemplateColumn that stacks the information.
I do have some code that worked 90% and may help you in your situation and would be happy to share it with you if you want. Using both the XamDataGrid and XamGrid I have been able to accomplish anything I have needed to do in a grid you just have to experiment sometimes.
Thank you for your post. I have been looking into it and I suggest you use get the ParentRow of the ColumnLayoutHeaderRow, which is the actual parent of the child band. You can do something like this:
xamGrid1.ActiveCell.Row.Manager.ParentRow.Manager.ParentRow
Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.