Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
Resizing child columns when resize parent column in Hirarchical data
posted

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.

 

 

Parents
No Data
Reply
  • 40030
    Suggested Answer
    Offline posted

    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

     

Children