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
40
Hierarchical Grid inside vertical splitter pane
posted

When I put a hierarchical grid inside a vertical splitter pane, the scrollbar for the splitter pane does not limit the size of the grid.  The grid keeps enlarging and goes outside of the pane.

Here is my sample page.

<body>
    <form id="form1" runat="server">
        <div class="Splitters">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <igweb:WebSplitter ID="VerticalSplitter" runat="server" OnPreRender="VerticalSplitter_PreRender" OnSplitterBarPositionChanged="VerticalSplitter_SplitterBarPositionChanged" OnSplitterPaneSizeChanged="VerticalSplitter_SplitterPaneSizeChanged" BorderStyle="Outset" Height="800px" BorderColor="#E0E0E0" ResizeWithBrowser="False" >
                <Panes>
                    <igweb:SplitterPane runat="server" CollapsedDirection="NextPane" MinSize="100px" Size="200px">
                        <Template>
                            <igweb:WebSplitter ID="HorizontalSplitter1" Orientation="Horizontal" runat="server"
                                OnSplitterBarPositionChanged="HorizontalSplitter_SplitterBarPositionChanged" OnSplitterPaneSizeChanged="HorizontalSplitter_SplitterPaneSizeChanged" BorderStyle="Outset" DynamicResize="True" Height="100%" BorderColor="Red">
                                <Panes>
                                    <igweb:SplitterPane runat="server" CollapsedDirection="NextPane" BackColor="White" BorderStyle="None" MinSize="25px">
                                        <Template>
                                            <ignav:UltraWebTree ID="UltraWebTree1" runat="server" DefaultImage="" HoverClass="" Indentation="20" Height="100%">
                                                <Nodes>
                                                    <ignav:Node Text="Locations">
                                                        <Nodes>
                                                            <ignav:Node Text="Location 1">
                                                                <Nodes>
                                                                    <ignav:Node Text="Location 1.1">
                                                                        <Nodes>
                                                                            <ignav:Node Text="Location 1.1.1">
                                                                                <Nodes>
                                                                                    <ignav:Node Text="Location 1.1.1.1">
                                                                                    </ignav:Node>
                                                                                </Nodes>
                                                                            </ignav:Node>
                                                                        </Nodes>
                                                                    </ignav:Node>
                                                                </Nodes>
                                                            </ignav:Node>
                                                            <ignav:Node Text="Location 2">
                                                            </ignav:Node>
                                                            <ignav:Node Text="Location 3">
                                                                <Nodes>
                                                                    <ignav:Node Text="Location 3.1">
                                                                    </ignav:Node>
                                                                </Nodes>
                                                            </ignav:Node>
                                                            <ignav:Node Text="Location 4">
                                                            </ignav:Node>
                                                        </Nodes>
                                                    </ignav:Node>
                                                </Nodes>
                                                <Levels>
                                                    <ignav:Level Index="0" />
                                                    <ignav:Level Index="1" />
                                                    <ignav:Level Index="2" />
                                                    <ignav:Level Index="3" />
                                                    <ignav:Level Index="4" />
                                                </Levels>
                                            </ignav:UltraWebTree>
                                        </Template>
                                    </igweb:SplitterPane>
                                    <igweb:SplitterPane runat="server" BackColor="White" BorderStyle="None" MinSize="25px" CollapsedDirection="PreviousPane">
                                        <Template>
                                            <ignav:UltraWebTree ID="UltraWebTree2" runat="server" DefaultImage="" HoverClass="" Indentation="20" HiliteClass="" Height="100%">
                                                <Nodes>
                                                    <ignav:Node Text="Reports">
                                                        <Nodes>
                                                            <ignav:Node Text="Report Group 1">
                                                                <Nodes>
                                                                    <ignav:Node Text="Report 1">
                                                                    </ignav:Node>
                                                                </Nodes>
                                                            </ignav:Node>
                                                            <ignav:Node Text="Report Group 2">
                                                                <Nodes>
                                                                    <ignav:Node Text="Report 10">
                                                                    </ignav:Node>
                                                                    <ignav:Node Text="Report 20">
                                                                    </ignav:Node>
                                                                </Nodes>
                                                            </ignav:Node>
                                                        </Nodes>
                                                    </ignav:Node>
                                                </Nodes>
                                                <Levels>
                                                    <ignav:Level Index="0" />
                                                    <ignav:Level Index="1" />
                                                    <ignav:Level Index="2" />
                                                </Levels>
                                            </ignav:UltraWebTree>
                                        </Template>
                                    </igweb:SplitterPane>
                                </Panes>
                            </igweb:WebSplitter>
                        </Template>
                    </igweb:SplitterPane>
                    <igweb:SplitterPane runat="server">
                        <Template>
                           <igtbl:UltraWebGrid id="uwgTest" runat="server" Height="100%" Width="100%"><Bands>
                            <igtbl:UltraGridBand Indentation="10">
                            <AddNewRow View="NotSet" Visible="NotSet"></AddNewRow>
                            <Columns>
                            <igtbl:TemplatedColumn AllowResize="Fixed" AllowRowFiltering="False" Width="20px" AllowGroupBy="No" FilterIcon="False"><CellTemplate>
                                <igtxt:WebImageButton ID="image" runat="server" >
                                    <Appearance>
                                        <Style BorderStyle="None" BackColor="Transparent" ></Style>
                                        <Image Url="~/images/search-on.jpg"  />
                                    </Appearance>
                                </igtxt:WebImageButton>  
                            </CellTemplate>
                            <CellStyle BorderColor="Transparent" BorderStyle="None" BackColor="Transparent"></CellStyle>
                            <CellButtonStyle BorderColor="Transparent" BorderStyle="None" BackColor="Transparent"></CellButtonStyle>
                            </igtbl:TemplatedColumn>
                            </Columns>
                            </igtbl:UltraGridBand>
                            </Bands>
                            <DisplayLayout Version="4.00" AllowSortingDefault="OnClient" IndentationDefault="10" AllowColSizingDefault="Free" StationaryMarginsOutlookGroupBy="True" HeaderClickActionDefault="SortMulti" Name="uwgTest" BorderCollapseDefault="Separate" RowSelectorsDefault="No" AllowAddNewDefault="Yes" RowHeightDefault="20px" SelectTypeRowDefault="Single">
                            <ActivationObject BorderWidth="" BorderColor="Black"></ActivationObject>
                            <FooterStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">
                            <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                            </FooterStyleDefault>
                            <RowStyleDefault BorderWidth="1px" BorderColor="Gray" BorderStyle="Solid" Font-Size="8pt" Font-Names="Verdana">
                            <BorderDetails ColorTop="White" ColorLeft="White"></BorderDetails>
                            <Padding Left="3px"></Padding>
                            </RowStyleDefault>
                            <FilterOptionsDefault AllowRowFiltering="OnClient" FilterUIType="FilterRow">
                            <FilterOperandDropDownStyle BorderWidth="1px" BorderColor="Silver" BorderStyle="Solid" Font-Size="11px" Font-Names="Verdana,Arial,Helvetica,sans-serif" BackColor="White" CustomRules="overflow:auto;">
                            <Padding Left="2px"></Padding>
                            </FilterOperandDropDownStyle>
                            <FilterHighlightRowStyle ForeColor="White" BackColor="#151C55"></FilterHighlightRowStyle>
                            <FilterDropDownStyle BorderWidth="1px" BorderColor="Silver" BorderStyle="Solid" Font-Size="11px" Font-Names="Verdana,Arial,Helvetica,sans-serif" BackColor="White" Width="200px" CustomRules="overflow:auto;">
                            <Padding Left="2px"></Padding>
                            </FilterDropDownStyle>
                            </FilterOptionsDefault>
                            <HeaderStyleDefault BorderStyle="Solid" BackColor="LightGray">
                            <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                            </HeaderStyleDefault>
                            <RowAlternateStyleDefault BackColor="#FFFFC0">
                            <BorderDetails ColorTop="255, 255, 192" ColorLeft="255, 255, 192"></BorderDetails>
                            <Padding Left="3px"></Padding>
                            </RowAlternateStyleDefault>
                            <EditCellStyleDefault BorderWidth="0px" BorderStyle="None"></EditCellStyleDefault>
                            <FrameStyle BorderWidth="1px" BorderStyle="None" Font-Size="8pt" Font-Names="Verdana" Width="100%" Height="100%"></FrameStyle>
                            <Pager Alignment="Center" PageSize="20" PagerAppearance="Both"></Pager>
                            <AddNewBox>
                            <BoxStyle BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">
                            <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                            </BoxStyle>
                            </AddNewBox>
                            </DisplayLayout>
                            </igtbl:UltraWebGrid>
                        </Template>
                    </igweb:SplitterPane>
                </Panes>
                <SplitterBar CssClass="SplitterBar" HoverCssClass="SplitterBarHover" ThicknessCssClass="SplitterBarThickness"
                    CollapseButtonCssClass="Collapse">
                </SplitterBar>
            </igweb:WebSplitter>
            <br />
        </div>
     </form>
</body>
 

 

Here is the code behind that populates the grid.

    DataSet ds = new DataSet();
   
    protected void Page_Load(object sender, EventArgs e)
    {
        uwgTest.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.Hierarchical;

        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("Region", typeof(string)));
        dt.Columns.Add(new DataColumn("Country", typeof(string)));

        DataRow newrow = null;

        newrow = dt.NewRow();
        newrow["Region"] = "Europe";
        newrow["Country"] = "Germany";
        dt.Rows.Add(newrow);
        newrow = dt.NewRow();
        newrow["Region"] = "Europe";
        newrow["Country"] = "France";
        dt.Rows.Add(newrow);
        newrow = dt.NewRow();
        newrow["Region"] = "Europe";
        newrow["Country"] = "Great Britain";
        dt.Rows.Add(newrow);
        newrow = dt.NewRow();
        newrow["Region"] = "Europe";
        newrow["Country"] = "Netherlands";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "Asia";
        newrow["Country"] = "China";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "Asia";
        newrow["Country"] = "China";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "Asia";
        newrow["Country"] = "Japan";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "Asia";
        newrow["Country"] = "Philipines";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "NA";
        newrow["Country"] = "US";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "NA";
        newrow["Country"] = "Canada";
        dt.Rows.Add(newrow);

        newrow = dt.NewRow();
        newrow["Region"] = "NA";
        newrow["Country"] = "Mexico";
        dt.Rows.Add(newrow);

        DataTable dt2 = new DataTable();
        dt2.Columns.Add(new DataColumn("Country", typeof(string)));
        dt2.Columns.Add(new DataColumn("City", typeof(string)));

        newrow = dt2.NewRow();
        newrow["Country"] = "Mexico";
        newrow["City"] = "Mexico City";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Chicago";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "New York";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "LA";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Boise";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Madison";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "LaCrosse";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Milwaukee";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Downers Grove";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Lisle";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Naperville";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Waukegan";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Whitewater";
        dt2.Rows.Add(newrow);

        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Glendale Heights";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Lombard";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Crystal Lake";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Algonquin";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Cary";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Harvard";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "River Forest";
        dt2.Rows.Add(newrow);


        newrow = dt2.NewRow();
        newrow["Country"] = "US";
        newrow["City"] = "Hillside";
        dt2.Rows.Add(newrow);

        DataTable dt3 = new DataTable();
        dt3.Columns.Add(new DataColumn("City", typeof(string)));
        dt3.Columns.Add(new DataColumn("Building", typeof(string)));

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "John Hancock";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Sears Tower";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "125 S. Wacker";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Lisle";
        newrow["Building"] = "5631 Elm St.";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 1";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 2";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 3";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 4";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 5";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 6";
        dt3.Rows.Add(newrow);

        newrow = dt3.NewRow();
        newrow["City"] = "Chicago";
        newrow["Building"] = "Building 7";
        dt3.Rows.Add(newrow);
       
        ds.Tables.Add(dt);
        ds.Tables.Add(dt2);
        ds.Tables.Add(dt3);

        ds.Relations.Add("Country_City", dt.Columns[1], dt2.Columns[0], false);
        ds.Relations.Add("City_Building", dt2.Columns[1], dt3.Columns[0], false);
        uwgTest.DataSource = ds;
        uwgTest.DataBind();

        uwgTest.Bands[0].AllowColSizing = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
        uwgTest.Bands[1].AllowColSizing = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
        uwgTest.Bands[2].AllowColSizing = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
        uwgTest.Bands[0].DefaultColWidth = new Unit("300px");
        uwgTest.Bands[1].DefaultColWidth = new Unit("300px");
        uwgTest.Bands[2].DefaultColWidth = new Unit("300px");
    }
 

  • 19308
    posted

    Try adding a style="position:reltive" to the container of the grid.  If you're putting the grid directly inside of the splitter pane, try wrapping it with a div (and setting position:relative on the div).

    -Tony