Infragistics(R) NetAdvantage(R) Windows Forms
ParentGroup Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > RowLayoutColumnInfo Class : ParentGroup Property

Returns the parent group which contains this group. This is only application when Infragistics.Win.UltraWinGrid.UltraGridBand.RowLayoutStyle is set to GroupLayout.

Syntax

Visual Basic (Declaration) 
Public Property ParentGroup As UltraGridGroup
C# 
public UltraGridGroup ParentGroup {get; set;}

Example

The following code demonstrates setting up a simple RowLayout with nested groups by using the RowLayoutStyle of the UltraGridBand and the ParentGroup property on the RowLayoutColumnInfo / RowLayoutGroupInfo or a column / group.

Visual BasicCopy Code
Imports Infragistics.Win.UltraWinGrid


    Private Sub UltraGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout

        ' Store the layout and root band in member variables for easy reference.
        Dim layout As UltraGridLayout = e.Layout
        Dim rootBand As UltraGridBand = layout.Bands(0)

        ' Set the RowLayoutStyle to allow groups in RowLayout mode. 
        rootBand.RowLayoutStyle = RowLayoutStyle.GroupLayout

        ' Add a couple of groups.
        Dim group1 As UltraGridGroup = rootBand.Groups.Add("Group 1")
        Dim group2 As UltraGridGroup = rootBand.Groups.Add("Group 2")

        ' Add some sub-groups which will be nested in the main groups. 
        Dim subGroup1A As UltraGridGroup = rootBand.Groups.Add("Sub-Group 1A")
        Dim subGroup1B As UltraGridGroup = rootBand.Groups.Add("Sub-Group 1B")
        Dim subGroup2A As UltraGridGroup = rootBand.Groups.Add("Sub-Group 2A")
        Dim subGroup2B As UltraGridGroup = rootBand.Groups.Add("Sub-Group 2B")

        ' Assign each sub-group to a parent group
        subGroup1A.RowLayoutGroupInfo.ParentGroup = group1
        subGroup1B.RowLayoutGroupInfo.ParentGroup = group1
        subGroup2A.RowLayoutGroupInfo.ParentGroup = group2
        subGroup2B.RowLayoutGroupInfo.ParentGroup = group2

        ' Assign each column to a group. 
        rootBand.Columns("Column 0").RowLayoutColumnInfo.ParentGroup = subGroup1A
        rootBand.Columns("Column 1").RowLayoutColumnInfo.ParentGroup = subGroup1A
        rootBand.Columns("Column 2").RowLayoutColumnInfo.ParentGroup = subGroup1B
        rootBand.Columns("Column 3").RowLayoutColumnInfo.ParentGroup = subGroup1B
        rootBand.Columns("Column 4").RowLayoutColumnInfo.ParentGroup = subGroup2A
        rootBand.Columns("Column 5").RowLayoutColumnInfo.ParentGroup = subGroup2A
        rootBand.Columns("Column 6").RowLayoutColumnInfo.ParentGroup = subGroup2B
        rootBand.Columns("Column 7").RowLayoutColumnInfo.ParentGroup = subGroup2B

    End Sub
C#Copy Code
using Infragistics.Win.UltraWinGrid;


        private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            // Store the layout and root band in member variables for easy reference.
            UltraGridLayout layout = e.Layout;
            UltraGridBand rootBand = layout.Bands[0];

            // Set the RowLayoutStyle to allow groups in RowLayout mode. 
            rootBand.RowLayoutStyle = RowLayoutStyle.GroupLayout;

            // Add a couple of groups.
            UltraGridGroup group1 = rootBand.Groups.Add("Group 1");
            UltraGridGroup group2 = rootBand.Groups.Add("Group 2");

            // Add some sub-groups which will be nested in the main groups. 
            UltraGridGroup subGroup1A = rootBand.Groups.Add("Sub-Group 1A");
            UltraGridGroup subGroup1B = rootBand.Groups.Add("Sub-Group 1B");
            UltraGridGroup subGroup2A = rootBand.Groups.Add("Sub-Group 2A");
            UltraGridGroup subGroup2B = rootBand.Groups.Add("Sub-Group 2B");

            // Assign each sub-group to a parent group
            subGroup1A.RowLayoutGroupInfo.ParentGroup = group1;
            subGroup1B.RowLayoutGroupInfo.ParentGroup = group1;
            subGroup2A.RowLayoutGroupInfo.ParentGroup = group2;
            subGroup2B.RowLayoutGroupInfo.ParentGroup = group2;

            // Assign each column to a group. 
            rootBand.Columns["Column 0"].RowLayoutColumnInfo.ParentGroup = subGroup1A;
            rootBand.Columns["Column 1"].RowLayoutColumnInfo.ParentGroup = subGroup1A;
            rootBand.Columns["Column 2"].RowLayoutColumnInfo.ParentGroup = subGroup1B;
            rootBand.Columns["Column 3"].RowLayoutColumnInfo.ParentGroup = subGroup1B;
            rootBand.Columns["Column 4"].RowLayoutColumnInfo.ParentGroup = subGroup2A;
            rootBand.Columns["Column 5"].RowLayoutColumnInfo.ParentGroup = subGroup2A;
            rootBand.Columns["Column 6"].RowLayoutColumnInfo.ParentGroup = subGroup2B;
            rootBand.Columns["Column 7"].RowLayoutColumnInfo.ParentGroup = subGroup2B;
        }

See Also