[CLOSED] GridPanel AutoExpandColumn

  1. #1

    [CLOSED] GridPanel AutoExpandColumn

    Hello,

    Geoffrey, perhaps you can help me out again. I've got a GridPanel which is concealed within an collapsed Panel. When I expand the Panel the AutoExpandColumn does not appear to work.

    Example.aspx:
    <%@ Page Language="C#" %>
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Customers.DataSource = new object[]
                {
                    new object[] { "Timothy Grant Vogelsang" }
                };
            Customers.DataBind();
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Word</title>
    </head>
    <body>
        <p><a href="Example.aspx">Reload</a></p>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            <ExtJS:Panel ID="Panel1" runat="server" AutoHeight="True" AutoScroll="True" BodyStyle="padding: 5px;" Border="False" Collapsible="True" Collapsed="True" Title="Panel 1">
                <Content>
                    <ExtJS:Store ID="Customers"
                        runat="server"
                        AutoLoad="True">
                        <Reader>
                            <ExtJS:ArrayReader>
                                <Fields>
                                    <ExtJS:RecordField Name="DisplayName" />
                                </Fields>
                            </ExtJS:ArrayReader>
                        </Reader>
                    </ExtJS:Store>
                    <ExtJS:GridPanel ID="dgPermission"
                        runat="server"
                        StoreID="Customers"
                        AutoExpandColumn="DisplayName"
                        HideHeaders="True"
                        StripeRows="True">
                        <ColumnModel>
                            <Columns>
                                <ExtJS:Column ColumnID="DisplayName" DataIndex="DisplayName" MenuDisabled="True" />
                            </Columns>
                        </ColumnModel>
                    </ExtJS:GridPanel>
                </Content>
            </ExtJS:Panel>
        </form>
    </body>
    </html>
    Any help would be appreciated, this one is a proper bugger.

    Cheers,
    Timothy
  2. #2

    RE: [CLOSED] GridPanel AutoExpandColumn

    Hi Timothy,

    try to wrap GridPanel into the FitLayout

    <%@ Page Language="C#" %>
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Customers.DataSource = new object[]
                {
                    new object[] { "Timothy Grant Vogelsang" }
                };
            Customers.DataBind();
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Word</title>
    </head>
    <body>
        <p><a href="Example.aspx">Reload</a></p>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:Store ID="Customers"
                runat="server"
                AutoLoad="True">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="DisplayName" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
            <ext:Panel ID="Panel1" runat="server" AutoHeight="True" AutoScroll="True" BodyStyle="padding: 5px;" Border="False" Collapsible="True" Collapsed="True" Title="Panel 1">
                <Content>
                    <ext:FitLayout runat="server">
                        <ext:GridPanel ID="dgPermission"
                            runat="server"
                            StoreID="Customers"
                            AutoExpandColumn="DisplayName"
                            HideHeaders="True"
                            StripeRows="True">
                            <ColumnModel>
                                <Columns>
                                    <ext:Column ColumnID="DisplayName" DataIndex="DisplayName" MenuDisabled="True" />
                                </Columns>
                            </ColumnModel>
                        </ext:GridPanel>
                    </ext:FitLayout>                
                </Content>
            </ext:Panel>
        </form>
    </body>
    </html>
  3. #3

    RE: [CLOSED] GridPanel AutoExpandColumn

    Cheers vlad, will give that a go!

    Timothy
  4. #4

    RE: [CLOSED] GridPanel AutoExpandColumn

    Worked beautifully vlad! I tried the FitLayout yesterday and it didn't work; but I think I had the Store and the GridPanel in the FitLayout which might have botched it up :)

    Cheers,
    Timothy
  5. #5

    Help Needed with auto expand column

    i have used AutoExpandColumn for grid panel. my grid works fine. but there is a small issue when i set the AutoExpandColumn property it leaves some space at the end of the grid. i have attached the image for more deatils.

    aspx is as below:

    <ext:FitLayout ID="FitLayout2" runat="server"> 
                                                        <ext:GridPanel ID="gpProduct" runat="server" StoreID="storeProductGrid" ClearEditorFilter="false"
                                                          AutoScroll="true"  StripeRows="true" Height="290" Border="false" AutoExpandColumn="Item">
                                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                                <Columns>
                                                                    <ext:Column ColumnID="Category" Header="<%$ Resources:Portal_Product, GRIDCOLUMNCATAGORY %>" Sortable="true" DataIndex="CategoryCode" Hidden="true" >
                                                                    </ext:Column>
                                                                    <ext:Column ColumnID="Family" Header="<%$ Resources:Portal_Product, GRIDCOLUMNFAMILY %>" Width="200" Sortable="true" DataIndex="FamilyName">
                                                                    </ext:Column>
                                                                    <ext:Column Header="<%$ Resources:Portal_Product, GRIDCOLUMNTYPE %>" Width="200" Sortable="true" DataIndex="TypeName">
                                                                    </ext:Column>
                                                                    <ext:Column Header="<%$ Resources:Portal_Product, GRIDCOLUMNPRODUCT %>" Width="172" Sortable="true" DataIndex="ProductName">
                                                                    </ext:Column>
                                                                    <ext:Column ColumnID="Item" Header="<%$ Resources:Portal_Product, GRIDCOLUMNComponent %>" Width="175" Sortable="true" DataIndex="ItemName">
                                                                    </ext:Column>
                                                                </Columns>
                                                            </ColumnModel>
    
                                                            <BottomBar>
                                                                <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" Width="750" />
                                                            </BottomBar>
                                                            
                                                        </ext:GridPanel>
                                                            </ext:FitLayout>
    Thanks
    Pooja
    Attached Thumbnails Click image for larger version. 

Name:	autoexpandcolumn.png 
Views:	247 
Size:	25.8 KB 
ID:	1942  
    Last edited by geoffrey.mcgill; Nov 25, 2010 at 3:56 AM. Reason: please use [CODE] tags
  6. #6
    @pooja - Please start a new forum thread, and please wrap all code samples in [CODE] tags, see

    http://forums.ext.net/showthread.php...ing-New-Topics
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] AutoExpandColumn does not seem to work
    By hgouw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 09, 2011, 8:58 AM
  2. [CLOSED] AutoExpandColumn in RowEditor
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 28, 2011, 8:51 AM
  3. [CLOSED] AutoExpandColumn and Columns in Codebehind
    By macap in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 23, 2010, 8:11 AM
  4. [CLOSED] TreeGrid with AutoExpandColumn
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: May 25, 2010, 12:30 PM
  5. [CLOSED] GridPanel.AutoExpandColumn issue
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 19, 2009, 5:07 PM

Posting Permissions