I am using Silverlight 4 with XamWebGrid 10.1. I am using ColumnLayout to achieve the master-detail. I have two questions. 1) how do I align the child columns with the parent columns? I know the WPF control has this capability but it doesn't automatically do this. 2) How do I sort within the child as well as the parent? The default is to sort the parent level, but I need to sort down to the child level as well. I was hoping that I do not have to write any code to calculate the size of the parent cell to match the child cell. I am using the grid to show groups the parent would be the sub total, and the child would be the detail. Anyway, thanks.
That worked. Thanks Steve.
Hi,
From Darrell's suggestion, the code would look something like:
void grid_ColumnSorted(object sender, SortedColumnEventArgs e){
if (e.Column.ColumnLayout.Key == "YourRootColumnLayoutKey") { e.Column.ColumnLayout.Columns.ColumnLayouts["ChildColumnLayouKey"].Columns.DataColumns[e.Column.Key].IsSorted = e.Column.IsSorted;
}}
Hope this helps,
-SteveZ
Do you have a sample? Listening to an event is one thing, but example would help me a lot.
You would need to listen to the sorting events and propagate the changes to the child level.
Ok, that works for the grouping, but how do I sort the child level? Even in the example on the web site it only sorts at the parent level while the child elements stay the same.