[CLOSED] Grouping Feature, trigger in Code Behind (VB.NET)

  1. #1

    [CLOSED] Grouping Feature, trigger in Code Behind (VB.NET)

    Hi all

    I need to trigger a Grouping Feature in Code Behind.

    I got this Grouping on my GridPanel:
                  <Features>
                    <ext:Grouping ID="grpDeclaration" runat="server" HideGroupedHeader="False" StartCollapsed="true" />
                  </Features>
    I tried to call the Feature after the Data Binding

        Dim grpFeature As Ext.Net.Grouping = CType(gridDeclarationVersion.Features(0), Grouping)
        grpFeature.collapseAll()
    But, that doesn't do anything :-(

    Any Hint
    Peter
    Last edited by Daniil; Nov 11, 2014 at 5:41 PM. Reason: [CLOSED]
  2. #2
    Hi Peter,

    I think this
    grpFeature.collapseAll()
    should throw a compile error, because there is no such the method. It is case-sensitive and it should be ".CollapseAll()".

    Here is a working example.

    Example
    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "group1", "1", "1" },
                    new object[] { "group1", "11", "11" },
                    new object[] { "group1", "111", "111" },
                    new object[] { "group2", "2", "2" },
                    new object[] { "group2", "22", "22" },
                    new object[] { "group2", "222", "222" }
                };
            }
        }
    
        protected void CollapseAll(object sender, DirectEventArgs e)
        {
            this.Grouping1.CollapseAll();
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Button runat="server" Text="Collapse all" OnDirectClick="CollapseAll" />
    
            <ext:GridPanel ID="GridPanel1" runat="server">
                <Store>
                    <ext:Store runat="server" GroupField="groupId">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="groupId" />
                                    <ext:ModelField Name="test1" />
                                    <ext:ModelField Name="test2" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="GroupId" DataIndex="groupId" />
                        <ext:Column runat="server" Text="Test1" DataIndex="test1" />
                        <ext:Column runat="server" Text="Test2" DataIndex="test2" />
                    </Columns>
                </ColumnModel>
                <Features>
                    <ext:Grouping ID="Grouping1" runat="server" />
                </Features>
            </ext:GridPanel>
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 3
    Last Post: Jul 24, 2014, 8:46 AM
  2. Grouping Feature with Custom sorting
    By glenh in forum 2.x Help
    Replies: 0
    Last Post: Jun 20, 2013, 5:44 AM
  3. [CLOSED] Feature Grouping
    By Akpenob in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 29, 2013, 4:51 AM
  4. [CLOSED] Grouping feature broken after latest from SVN
    By jchau in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 19, 2013, 4:09 AM
  5. Replies: 2
    Last Post: Mar 06, 2013, 3:45 PM

Posting Permissions