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
590
XamWebGrid Move Child Columns
posted

I am using XamWebGrid 10.1, I am using ColumnLayout to show parent/child details, and want to be able to move columns around, when I enable it the parent level moves, but want to know if it is possible to move the child columns with it.

I was trying Grid_ColumnDropped(object sender, ColumnDroppedEventArgs e) event but not sure if there is way to move the columns in code.

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    So Column moving actually is just moving columns from within the collection. 

    So, for your child ColumnLayouts, you would just remove the column, and insert it to the same index as the parent column. 

    ColumnBase col =  columnLayout.Columns["ParentColumnKey]);

    columnLayout.Columns.Remove(col)
    Columnlayout.Columns.Insert(parentIndex, col); 

    Hope this helps, 

    -SteveZ

Children