[CLOSED] Nested childgrid autoselection issue

Page 2 of 2 FirstFirst 12
  1. #11
    Hi @fabrico

    I added github link thinking it will be easier for you to address the issue
    please check code below ,

    Default.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
    
    
        <script type="text/javascript">
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    
    
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
    
                <ext:ResourceManager ID="ResourceManager1" runat="server" CleanResourceUrl="true" DirectMethodNamespace="DM" Namespace="app">
                </ext:ResourceManager>
    
                <ext:Viewport runat="server">
                    <Items>
    
                        <ext:GridPanel
                            ID="GridPanel1"
                            runat="server"
                            Title="Array Grid"
                            Width="700" AutoHeight="true">
                            <Store>
                                <ext:Store ID="Store1" runat="server" PageSize="10">
                                    <Model>
                                        <ext:Model runat="server">
                                            <Fields>
                                                <ext:ModelField Name="company" />
                                                <ext:ModelField Name="price" Type="Float" />
                                                <ext:ModelField Name="change" Type="Float" />
                                                <ext:ModelField Name="pctChange" Type="Float" />
                                                <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                                            </Fields>
    
                                        </ext:Model>
    
                                    </Model>
    
                                </ext:Store>
                            </Store>
    
    
                            <ColumnModel runat="server">
                                <Columns>
    
    
                                    <ext:Column ID="Company" Header="Company" DataIndex="company" runat="server" />
    
                                    <ext:Column Header="Price" DataIndex="price" runat="server">
                                        <Renderer Format="UsMoney" />
                                    </ext:Column>
                                    <ext:Column ColumnID="Change" Header="Change" DataIndex="change" runat="server">
                                        <Renderer Fn="change" />
                                    </ext:Column>
                                    <ext:Column Header="Change" DataIndex="pctChange" runat="server">
                                        <Renderer Fn="pctChange" />
                                    </ext:Column>
                                    <ext:DateColumn Header="Last Updated" DataIndex="lastChange" runat="server" />
                                </Columns>
                            </ColumnModel>
    
                            <SelectionModel>
                                <ext:CheckboxSelectionModel runat="server"></ext:CheckboxSelectionModel>
                            </SelectionModel>
    
                            <View>
                                <ext:GridView runat="server" StripeRows="true" />
                            </View>
    
                            <Plugins>
    
                                <ext:RowExpander ID="gridResultsExpander" Visible="true" runat="server" ExpandOnDblClick="false">
    
                                    <Component>
    
                                        <ext:GridPanel
                                            ID="gridChild1"
                                            runat="server"
                                            Width="500" AutoHeight="true" EnableColumnHide="false">
                                            <Store>
                                                <ext:Store ID="Store2" runat="server" PageSize="10">
                                                    <Model>
                                                        <ext:Model runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="company" />
                                                                <ext:ModelField Name="price" Type="Float" />
                                                                <ext:ModelField Name="change" Type="Float" />
    
                                                            </Fields>
                                                        </ext:Model>
    
                                                    </Model>
    
                                                </ext:Store>
                                            </Store>
                                            <ColumnModel runat="server">
                                                <Columns>
                                                    <ext:Column ColumnID="Company" Header="Company" DataIndex="company" runat="server" />
                                                    <ext:Column Header="Price" DataIndex="price" runat="server">
                                                        <Renderer Format="UsMoney" />
                                                    </ext:Column>
                                                </Columns>
                                            </ColumnModel>
    
                                            <SelectionModel>
                                                <ext:CheckboxSelectionModel runat="server" XCheckOnly="true" PruneRemoved="false" ShowHeaderCheckbox="false" CheckOnly="true">
                                                </ext:CheckboxSelectionModel>
                                            </SelectionModel>
    
    
                                        </ext:GridPanel>
    
                                    </Component>
                                </ext:RowExpander>
    
                            </Plugins>
                        </ext:GridPanel>
    
                    </Items>
    
                </ext:Viewport>
    
    
            </div>
        </form>
    </body>
    </html>

    c# code below
    default.aspx.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    public partial class _Default : System.Web.UI.Page{
    
    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                
                this.Store1.DataSource = this.Data;
                this.Store1.DataBind();
    
    
    
                this.Store2.DataSource = this.Data2;
                this.Store2.DataBind();
            }
        }
    
        protected void MyData_Refresh(object sender, StoreDirectEvents  e)
        {
            this.BindData();
        }
    
        protected void MyChildData_Refresh(object sender, StoreDirectEvents e)
        {
            this.BindChildData();
        }
    
        private void BindData()
        {
            Store store = this.GridPanel1.GetStore();
    
            store.DataSource = this.Data;     
            store.DataBind();
        }
    
        private void BindChildData()
        {
            Store store = this.gridChild1.GetStore();
    
            store.DataSource = this.Data2;
            store.DataBind();
        }
    
    
        private object[] Data
        {
            get
            {
                DateTime now = DateTime.Now;
    
                return new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, 0.03, now },
                    new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, now },
                    new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, now },
                    new object[] { "American Express Company", 52.55, 0.01, 0.02, now },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, 0.49, now },
                    new object[] { "AT&T Inc.", 31.61, -0.48, -1.54, now },
                    new object[] { "Boeing Co.", 75.43, 0.53, 0.71, now },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, 1.39, now },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, 0.04, now },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, now },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, -0.64, now },
                    new object[] { "General Electric Company", 34.14, -0.08, -0.23, now },
                    new object[] { "General Motors Corporation", 30.27, 1.09, 3.74, now },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, -0.08, now }
                };
            }
        }
    
    
        private object[] Data2
        {
            get
            {
                DateTime now = DateTime.Now;
    
                return new object[]
                {
                    new object[] { "Wipro", 71.72,now },
                    new object[] { "Infosys", 29.01,  1.47, now },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45,  now }
                };
            }
        }
    
    
    
    }
  2. #12
    Hello @asifsolkar!

    Sorry, we understand you wanted to make it simple, but for several reasons we decided not to support sharing projects. To name one, a project you shared today may not be available tomorrow for the ones having the same issue. And having the simplified code on the thread really makes it both easier to be reproduced and easier to be replied -- as the code source is smaller. Also easier to have the solution understood.

    Additionally, per our guidelines on forums it has been mentioned that a project file should be provided only when requested, but turned out this did turn out that it was easier and always possible to provide the code sample in [code] tags in the end... So we recently decided on dropping full project sharing off completely. Another implication would be the chance keys were being publicized and code not meant to were being also duplicated (like proprietary algorithms, for example).

    Well, explanations given, we'll be analyzing your sample code and will return soon with feedback!

    Hope you understand!
    Fabrício Murta
    Developer & Support Expert
  3. #13
    Hello again, and for the feedback.

    Well, this will not be a long explanation but there are limitations on the Row Expander plugin that you are just exploring them. Unfortunately they are known not to work and should be avoided.

    Please refer to this example, it mentions this checkbox selection model and other limitations on nested grid panels: Grid Panel > Row Expander > Multi Level.

    Sorry the news are not really great, but I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  4. #14
    Hi @Fabrico

    Will this work with ext 4.1 ?
  5. #15
    Hello @asifsolkar!

    Unfortunately no, these issues are still in place down the road to Ext.NET 4.1. As you can see in the corresponding RowExpander example.
    Fabrício Murta
    Developer & Support Expert
  6. #16
    Do we have any update here ? Downloaded latest from SVN Yesterday 23-Jan-2017, still doesn't seem to work.
  7. #17
    Hello @amitpareek!

    This still is a limitation with the row expander model, unfortunately.
    Fabrício Murta
    Developer & Support Expert
  8. #18
    Hello again @amitpareek!

    Although there's this limitation it does not mean there's no solution for this on Ext.NET 4. If you want us to try and show you alternatives on enabling this behavior with nested grid panels, please open a thread on 4.x forums. I'm sure we can get up to something.
    Fabrício Murta
    Developer & Support Expert
  9. #19
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 9
    Last Post: Jun 17, 2016, 1:16 PM
  2. [CLOSED] Issue with validate change on nested grid panel
    By REB in forum 4.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 13, 2016, 8:10 PM
  3. Prevent select all On Childgrid
    By asifsolkar in forum 2.x Help
    Replies: 0
    Last Post: May 20, 2016, 10:46 AM
  4. [CLOSED] Issue in layout with nested user controls [1.6]
    By lapix in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 05, 2012, 2:17 PM
  5. [CLOSED] Nested Layout issue
    By blueworld in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Oct 02, 2012, 2:31 PM

Tags for this Thread

Posting Permissions