Hi,
I m showing parent child realtionship in web grid. I hve set Indentation="0" so that it shows common headers for all parent and child. Now when it tried to expand first column then only root elements column gets resized and child column not changing so its looking odd. I want to change width of all clumns simulteneously on changing common header column.So how can i do that.
Please help.
Thanks,
Mahendra.
Hi Mahendra,
Is the data on your Root level and on your ChildBand represented by the same Data object? If so, then you could use the same ColumnLayout for both bands. Which means the data would be represented by the same columns. So when you resize one, the other will be resized. This can be done by using the TargetTypeName property on the ColumnLayout, and defining that ColumnLayout in the grid's ColumnLayouts collection.
So, if you bound your grid to a List<Person> objects, and a Person object has a property called Children, which is has a List<Person> objects, then the Root ColumnLayout and the ChildBand would both be represented by Person objects. Which means you could do the following.
<ig:XamWebGrid>
<ig:XamWebGrid.ColumnLayouts>
<ig:ColumnLayout TargetTypeName="Person" / >
</ig:XamWebGrid.ColumnLayouts>
<./ig:XamWebGrid>
If this is not the case, and you're using the Indicator Resizing, then another option is to use the Events that we provided for ColumnResizing.
-SteveZ
hi,
I tried this in igModelGrid_ColumnLayoutAssigned event. following is the code
e.ColumnLayout.Columns.Add(
new ColumnLayout() { TargetTypeName = "MyData", Key = "lstChildData", HeaderVisibility = Visibility.Collapsed });In my code i hve added TargetTypeName. Is it right or something different to set in codePlease give code how can i do that from code...
Mahendra