[CLOSED] Row Expander with inner grid - render inner grid's row from database

  1. #1

    [CLOSED] Row Expander with inner grid - render inner grid's row from database

    Hello I have a Grid with Row Expander and an Inner Grid,
    how I can render Inner Grid's rows (InnerStore , countries) from database instead of loading the in Page_Load?
    Code:
    <%@ Page Language="C#"%>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack && !X.IsAjaxRequest)
                {
    
    
                }
    
                //RowExpander Values
                this.Store1.DataSource = new object[]
                    {
                        new object[] { "Countries"},
                        new object[] { "Categories"}               
                    };
    
                this.Store1.DataBind();
    
                InnerStore.DataSource = new object[]
                    {
                        new { countries = "Greece"},
                        new { countries = "Italy"}               
                    };
    
                InnerStore.DataBind();
               
            }
    </script>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>eTMF</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
                <div>
                    <ext:Viewport 
                        runat="server"
                        StyleSpec="background-color: transparent;"
                        Layout="BorderLayout"
                        >
                        <Items> 
                            <ext:GridPanel 
                                runat="server" 
                                Title="GridPanel Expander" 
                                Collapsible="true"
                                AnimCollapse="true"
                                Flex="1"
                                Region="West"                           
                                >
                                <Store>
                                    <ext:Store
                                        ID="Store1"
                                        runat="server"
                                        IgnoreExtraFields="false"
                                        PageSize="10">
                                        <Model>
                                            <ext:Model ID="Model2" runat="server">
                                                <Fields>
                                                    <ext:ModelField Name="filters" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Store>
                                <ColumnModel ID="ColumnModel1" runat="server">
                                    <Columns>
                                        <ext:Column ID="Column2"
                                            runat="server"
                                            Text="Filter"
                                            DataIndex="filters"
                                            Flex="1" />
                                    </Columns>
                                </ColumnModel>
                                <Plugins>
                                    <ext:RowExpander ID="RowExpander1" runat="server" SingleExpand="false">
                                        <Component>
                                            <ext:GridPanel ID="InnerGridExpander"
                                                runat="server"
                                                Cls="white-footer"
                                                HideHeaders="true"
                                                >
                                                <Store>
                                                    <ext:Store ID="InnerStore" runat="server">
                                                        <Model>
                                                            <ext:Model runat="server">
                                                                <Fields>
                                                                    <ext:ModelField Name="countries" />
                                                                </Fields>
                                                            </ext:Model>
                                                        </Model>
                                                    </ext:Store>
                                                </Store>
                                                <ColumnModel runat="server">
                                                    <Columns>
                                                        <ext:Column runat="server" DataIndex="countries" />
                                                    </Columns>
                                                </ColumnModel>
                                            </ext:GridPanel>
                                        </Component>
                                    </ext:RowExpander>
                                </Plugins>
                            </ext:GridPanel>
                       </Items>                        
            </ext:Viewport>
        </div>
        </form>
    </body>
    </html>
    Last edited by fabricio.murta; Feb 25, 2017 at 4:09 AM. Reason: no user feedback for 7+ days
  2. #2
    Hello @atroul!

    You probably will need Page_Load() to fill the data source with database info or some sort of WebForms data binding.

    By chance, I did a test in Examples Explorers today and got a list with all examples that involve database connection, so here goes the list:
    GridPanel - DataSource Controls:
    - Linq Data Source
    - Object Data Source
    - SQL Data Source

    GridPanel - Data with Details
    - Form Details
    - One-to-Many

    GridPanel - Miscellaneous
    - Details Window (local)
    - Details Window (remote)

    GridPanel - Saving Variations
    - Store with Custom Logic
    - Store Events

    GridPanel - System Data
    - Data Reader

    GridPanel - Update methods
    - GridPanel - Update - SQL Data Source

    Well, browse for your heart's content! I'm sure you are going to see insightful examples that will help you figure out the best way to attach database data to your grid panel among those examples!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello @atroul!

    It's been some time since we left a feedback for you here and still no response from your side. Do you still needs something regarding this thread?
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Row Expander is collapsed after Grid Refresh
    By Geovision in forum 3.x Legacy Premium Help
    Replies: 9
    Last Post: Mar 02, 2016, 2:54 PM
  2. Need Help with the Multi Level Grid using Row Expander
    By seshukumar2601 in forum 3.x Help
    Replies: 5
    Last Post: Nov 25, 2015, 5:48 AM
  3. Replies: 0
    Last Post: Aug 23, 2013, 11:16 AM
  4. Same store used in both grid & row expander
    By Hemavathi in forum 1.x Help
    Replies: 0
    Last Post: Oct 26, 2012, 6:48 AM
  5. Replies: 6
    Last Post: Oct 15, 2012, 6:20 AM

Posting Permissions