[CLOSED] AutoHeight gridpanel and scrollbars

  1. #1

    [CLOSED] AutoHeight gridpanel and scrollbars

    The grid should occupy all the space vertically.
    I set AutoHeight true
    I set the property to true AutoHeight.

    But the scrollbars do not appear.
    For this reason the grid is unusable
    the grid must extend throughout the vertical space and have the scrollbars to see all the records.
    How do I do?

     <%@PageLanguage="C#"AutoEventWireup="true"CodeBehind="Consultazione.aspx.cs"Inherits="WAY.Accise.Consultazione" %>
    <%@RegisterAssembly="Ext.Net"Namespace="Ext.Net"TagPrefix="ext" %>
    <!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <htmlxmlns="http://www.w3.org/1999/xhtml">
    <headid="Head1"runat="server"enableviewstate="false">
     
    <title>WAY - Accise</title>
    <linkhref="Css/StyleSheet.css"rel="Stylesheet"type="text/css"/>
    <linkrel="Stylesheet"type="text/css"href="<%#GetWAYResource("CSS/environmentMenu.css") %>"/>
     
    </head>
    <body>
    <formid="form1"runat="server">
    <ext:ResourceManagerID="ResourceManager1"runat="server"/>
    <ext:ViewportID="ViewPort1"runat="server">
    <Items>
    <ext:BorderLayoutID="BorderLayout1"runat="server">
    <NorthSplit="false"Collapsible="false">
    <ext:PanelID="Panel1"
    Height="50"
    runat="server"
    TitleCollapse="true"
    Layout="fit">
    <Listeners>
    <BeforeRenderFn="addMenu"/>
    </Listeners>
    </ext:Panel>
    </North>
    <WestMinWidth="225"MaxWidth="400"Split="true">
    <ext:Panel
    ID="WestPanel"
    TitleCollapse="true"
    runat="server"
    Title=""
    Width="225"
    BodyStyle="padding:20px;">
    <Content>
    <tablecellspacing="0"cellpadding="0"border="0">
    <tbody>
    <tr>
    <tdstyle="height:30px;">
    Data iniziale: 
    </td>
    </tr>
     
    <tr>
    <tdstyle="height:30px;">
    <ext:DateFieldID="DataIniziale"Format="dd/MM/yyyy"Width="150"Editable="false"runat="server"></ext:DateField>
    </td>
    </tr>
    <tr>
    <tdstyle="height:30px;">
    Data finale: 
    </td>
    </tr>
     
    <tr>
    <tdstyle="height:30px;">
    <ext:DateFieldID="DataFinale"Format="dd/MM/yyyy"Width="150"Editable="false"runat="server"></ext:DateField>
    </td>
    </tr>
     
    <tr>
    <tdstyle="height:60px;">
    <ext:ButtonID="ButtonViewer"Icon="ApplicationViewList"runat="server"Text="Visualizza">
    <DirectEvents>
    <ClickOnEvent="GetList">
    <EventMaskShowMask="true"/>
    </Click>
    </DirectEvents>
    </ext:Button>
    </td>
    </tr>
    <tr>
    <tdcolspan="2"style="height:30px;"></td></tr></tbody>
    </table>
    </Content>
    </ext:Panel>
    </West>
    <Center>
    <ext:Panel
    ID="PanelGrid"
    runat="server"
     
    Padding="10"
    BodyStyle="background:#DFE8F6;"
    AutoScroll="false"
    Width="350"
    AutoHeight="true"
    Border="false"
    Title="">
    <Content>
    <ext:GridPanel
    ID="GridPanel1"
    runat="server"
    AutoHeight="true"
    AutoScroll="true"
    StripeRows="true"
    Title="Array Grid"
    TrackMouseOver="true"
    Width="600">
    <Store>
    <ext:StoreID="StoreAcciseData"runat="server">
    <Reader>
    <ext:JsonReaderIDProperty="ID">
    <Fields>
    <ext:RecordFieldName="Name"/>
    <ext:RecordFieldName="Type"/>
    <ext:RecordFieldName="Model"/>
    <ext:RecordFieldName="Category"/>
    <ext:RecordFieldName="WorkSite"/>
    <ext:RecordFieldName="Engine1Brand"/>
    <ext:RecordFieldName="Engine1Model"/>
    <ext:RecordFieldName="Engine1FuelType"/>
    <ext:RecordFieldName="Engine1HLInitial"/>
    <ext:RecordFieldName="Engine1HLFinal"/>
    <ext:RecordFieldName="Engine1HLGap"/>
    <ext:RecordFieldName="Engine1REInitial"/>
    <ext:RecordFieldName="Engine1REFinal"/>
    <ext:RecordFieldName="Engine1REGap"/>
    <ext:RecordFieldName="Engine2Brand"/>
    <ext:RecordFieldName="Engine2Model"/>
    <ext:RecordFieldName="Engine2FuelType"/>
    <ext:RecordFieldName="Engine2HLInitial"/>
    <ext:RecordFieldName="Engine2HLFinal"/>
    <ext:RecordFieldName="Engine2HLGap"/>
    <ext:RecordFieldName="Engine2REInitial"/>
    <ext:RecordFieldName="Engine2REFinal"/>
    <ext:RecordFieldName="Engine2REGap"/>
    <ext:RecordFieldName="ExemptLiters"/>
    </Fields>
    </ext:JsonReader>
    </Reader>
    <Listeners>
    <LoadExceptionHandler="Ext.Msg.alert('Employees - Load failed', e.message || response.statusText);"/>
    </Listeners>
    </ext:Store>
    </Store>
    <ColumnModelID="ColumnModel2"runat="server">
    <Columns>
    <ext:ColumnDataIndex="Name"Header="Name"Width="150"/>
    <ext:ColumnDataIndex="ExemptLiters"Header="Litri Agevolati"Width="150"/>
    </Columns>
    </ColumnModel>
    <SelectionModel>
    <ext:RowSelectionModelID="RowSelectionModel1"runat="server"SingleSelect="true"/>
    </SelectionModel>
    </ext:GridPanel>
     
     
     
     
    </Content>
    </ext:Panel>
    </Center>
    </ext:BorderLayout>
    </Items>
    </ext:Viewport>
    </form>
    </body>
    </html>
    Attached Thumbnails Click image for larger version. 

Name:	cool1.jpg 
Views:	193 
Size:	66.8 KB 
ID:	1644  
    Last edited by Daniil; Sep 23, 2010 at 3:12 PM. Reason: Please use [code] tags, [CLOSED]
  2. #2
    Hi,

    Please don't use the autoHeight property when you want to enable a vertical scrollbar.

    To fit content to container's size please use Layout="fit", not autoHeight.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.Store.Primary;
                store.DataSource = new object[] { 
                                             new object[] {"test11", "test12", "test13"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test21", "test22", "test23"},
                                             new object[] {"test31", "test32", "test33"}
                                    };
                store.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Viewport runat="server" Layout="border">
            <Items>
            <ext:Panel 
                runat="server" 
                Region="North" 
                Height="500" 
                Html="South" />
                <ext:Panel runat="server" Region="Center" Layout="fit">
                    <Items>
                        <ext:GridPanel ID="GridPanel1" runat="server">
                            <Store>
                                <ext:Store runat="server">
                                    <Reader>
                                        <ext:ArrayReader>
                                            <Fields>
                                                <ext:RecordField Name="test1" />
                                                <ext:RecordField Name="test2" />
                                                <ext:RecordField Name="test3" />
                                            </Fields>
                                        </ext:ArrayReader>
                                    </Reader>
                                </ext:Store>
                            </Store>
                            <ColumnModel runat="server">
                                <Columns>
                                    <ext:Column Header="Test1" DataIndex="test1" />
                                    <ext:Column Header="Test2" DataIndex="test2" />
                                    <ext:Column Header="Test3" DataIndex="test3" />
                                </Columns>
                            </ColumnModel>
                        </ext:GridPanel>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Gridpanel enable horizontal scrollbars
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 08, 2012, 7:03 PM
  2. [CLOSED] Accordion + GridPanel + hidden ScrollBars
    By asztern in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 09, 2011, 5:12 PM
  3. [CLOSED] GridPanel vertical scrollbars
    By state in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 14, 2009, 7:07 PM
  4. [CLOSED] GridPanel scrollbars
    By danielg in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 21, 2009, 1:01 AM
  5. [CLOSED] Column alignment with scrollbars in GridPanel
    By jsemple in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Mar 09, 2009, 3:58 PM

Posting Permissions