DataForm: Group Layouts

TKEntityPropertyGroupView allows you to arrange the editors in the group using different layouts that confirm to TKLayout protocol through its layout property. By default the group view uses TKStackLayout, but you could easily change it to let's say TKGridLayout. The code snippet below shows how to change the layout of a group view:

groupView.Collapsible = true;
if (groupIndex == 0) {
    TKGridLayout grid = new TKGridLayout ();
    groupView.EditorsContainer.Layout = grid;
    int row = 0;
    int col = 0;
    foreach (UIView editor in groupView.EditorsContainer.Items) {
        TKGridLayoutCellDefinition editorDefinition = grid.DefinitionForView (editor);
        editorDefinition.Row = new NSNumber (row);
        editorDefinition.Column = new NSNumber (col);
        col++;
        if (col == 2) {
            row++;
            col = 0;
        }
    }
}