[CLOSED] The panel will detail a button that performs the update with a server-side method.

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] The panel will detail a button that performs the update with a server-side method.

    I need to refresh the grid without losing the selected record
    this.Store1.DataBind();
    not working!!!

    I can only update the grid by

    protected void CaricaGriglia()
            {
               List<ObjMacchineOperatrici> list = new List<ObjMacchineOperatrici>();
               // Creo una lista degli attributi desiderati
               List<ObjVehicleAttributeType> attributesList = new List<ObjVehicleAttributeType>();
               attributesList.Add(BusinessVehicleAttributeType.GetById(400));
               attributesList.Add(BusinessVehicleAttributeType.GetById(401));
               attributesList.Add(BusinessVehicleAttributeType.GetById(402));
               attributesList.Add(BusinessVehicleAttributeType.GetById(403));
               // Carico una lista di veicoli che abbiano almeno un attributo dei precedenti
               List<ObjVehicle> vehiclesList = new List<ObjVehicle>();
               vehiclesList = BusinessVehicle.GetList(((Global)Context.ApplicationInstance).WEBSession.IDUser, attributesList);
               //vehiclesList = BusinessVehicle.GetList(((Global)Context.ApplicationInstance).WEBSession.IDUser);
               // Carico il DTO
               foreach (ObjVehicle v in vehiclesList)
                {
                    ObjMacchineOperatrici ojm = new ObjMacchineOperatrici { ID = v.ID, Identificativo = v.Name, Categoria = v.Attributes[0].VehicleAttributeType.Name, Modello = v.Model, Telaio = v.Plate, CodiceWayCounter = v.CommunicationDevice.Name, RiferimentoTaratura = v.SealCode, CodiceHardware = v.CommunicationDevice.HwCode, Tipo = v.ModelType, CreationUser = v.CommunicationDevice.CreationUser.Description, CreationDate = v.CommunicationDevice.CreationDate, UpdateUser = v.UpdateUser.Description, UpdateDate = v.UpdateDate };
                    if (v.Engines != null && v.Engines.Count > 0 && v.Engines[0] != null)
                    {
                        ojm.Motore1 = v.Engines[0].EngineModel.StringIdentifier;
                    }
                    if (v.Engines != null && v.Engines.Count > 1 && v.Engines[1] != null)
                    {
                        ojm.Motore2 = v.Engines[1].EngineModel.StringIdentifier;
                    }
                    list.Add(ojm);
                }
                StoreVeicoli.DataSource = list;
                StoreVeicoli.DataBind();
                
            }
    Is there an easier way to update the grid while maintaining the selected row?


    but in doing so lose the selected row
    Last edited by geoffrey.mcgill; Sep 24, 2010 at 3:01 PM. Reason: please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    If you would like to refresh a GridPanel on server side, yes, it needs to repopulate a Store.

    To enable the mechanism of selections saving please set the SelectionMemory property of GridPanel to Enabled and use the IDProperty of Store's Reader.

    This example demonstrates the above.

    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)
            {
                this.BindData();
            }
        }
    
        protected void MyData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            this.BindData();   
        }
    
        private void BindData()
        {
            var store = this.GridPanel1.GetStore();
            
            store.DataSource = this.Data;
            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 },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, 0.13, now },
                    new object[] { "Intel Corporation", 19.88, 0.31, 1.58, now },
                    new object[] { "International Business Machines", 81.41, 0.44, 0.54, now },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, 0.09, now },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, 0.15, now },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, 2.40, now },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, 1.01, now },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, 0.54, now },
                    new object[] { "Pfizer Inc", 27.96, 0.4, 1.45, now },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, 0.58, now },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now },
                    new object[] { "Verizon Communications", 35.57, 0.39, 1.11, now },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now }
                };
            }
        }
    </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:GridPanel
                ID="GridPanel1"
                runat="server" 
                StripeRows="true"
                Title="Array Grid" 
                Width="600" 
                Height="290"
                AutoExpandColumn="Company"
                SelectionMemory="Enabled">
                <Store>
                    <ext:Store runat="server" OnRefreshData="MyData_Refresh">
                        <Reader>
                            <ext:ArrayReader IDProperty="company">
                                <Fields>
                                    <ext:RecordField Name="company" />
                                    <ext:RecordField Name="price" Type="Float" />
                                    <ext:RecordField Name="change" Type="Float" />
                                    <ext:RecordField Name="pctChange" Type="Float" />
                                    <ext:RecordField Name="lastChange" Type="Date" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column 
                            ColumnID="Company" 
                            Header="Company" 
                            Width="160" 
                            DataIndex="company" />
                        <ext:Column Header="Price" Width="75" DataIndex="price" />
                        <ext:Column Header="Change" Width="75" DataIndex="change" />
                        <ext:Column Header="Change" Width="75" DataIndex="pctChange" />
                        <ext:DateColumn 
                            Header="Last Updated" 
                            Width="85" 
                            DataIndex="lastChange" 
                            Format="H:mm:ss" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel runat="server" />
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar runat="server" />
                </BottomBar>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  3. #3
    'Ext.Net.GridPanel''GetStore' undefined

    i added

    <ext:Button ID="Button1" runat="server" Text="Button #1">
    <Listeners>
    <Click Handler="Store1.reload" />
    </Listeners>
    </ext:Button>
     
    This is the correct approach to refresh data?
     
     
     
    the correct code is this
     
     
    <%@ 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)
    {
    this.BindData();
    }
    }
    protected void MyData_Refresh(object sender, StoreRefreshDataEventArgs e)
    {
    this.BindData();
    }
    private void BindData()
    {
    
    Store1.DataSource = this.Data;
    Store1.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 }, new object[] { "Honeywell Intl Inc", 38.77, 0.05, 0.13, now }, new object[] { "Intel Corporation", 19.88, 0.31, 1.58, now }, new object[] { "International Business Machines", 81.41, 0.44, 0.54, now }, new object[] { "Johnson & Johnson", 64.72, 0.06, 0.09, now }, new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, 0.15, now }, new object[] { "McDonald\"s Corporation", 36.76, 0.86, 2.40, now }, new object[] { "Merck & Co., Inc.", 40.96, 0.41, 1.01, now }, new object[] { "Microsoft Corporation", 25.84, 0.14, 0.54, now }, new object[] { "Pfizer Inc", 27.96, 0.4, 1.45, now }, new object[] { "The Coca-Cola Company", 45.07, 0.26, 0.58, now }, new object[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now }, new object[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now }, new object[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now }, new object[] { "Verizon Communications", 35.57, 0.39, 1.11, now }, new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now } };
    }
    } </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 id="Head1" runat="server">
    <title>Ext.NET Example</title>
    </head>
    <body>
    <form id="Form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
    
    <ext:Button ID="Button1" runat="server" Text="Button #1">
    <Listeners>
    <Click Handler="Store1.reload" />
    </Listeners>
    </ext:Button>
    
    
    <ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" Title="Array Grid"
    Width="600" Height="290" AutoExpandColumn="Company" SelectionMemory="Enabled">
    <Store>
    <ext:Store ID="Store1" runat="server" OnRefreshData="MyData_Refresh">
    <Reader>
    <ext:ArrayReader IDProperty="company">
    <Fields>
    <ext:RecordField Name="company" />
    <ext:RecordField Name="price" Type="Float" />
    <ext:RecordField Name="change" Type="Float" />
    <ext:RecordField Name="pctChange" Type="Float" />
    <ext:RecordField Name="lastChange" Type="Date" />
    </Fields>
    </ext:ArrayReader>
    </Reader>
    </ext:Store>
    </Store>
    <ColumnModel ID="ColumnModel1" runat="server">
    <Columns>
    <ext:RowNumbererColumn />
    <ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="company" />
    <ext:Column Header="Price" Width="75" DataIndex="price" />
    <ext:Column Header="Change" Width="75" DataIndex="change" />
    <ext:Column Header="Change" Width="75" DataIndex="pctChange" />
    <ext:DateColumn Header="Last Updated" Width="85" DataIndex="lastChange" Format="H:mm:ss" />
    </Columns>
    </ColumnModel>
    <SelectionModel>
    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
    </SelectionModel>
    <LoadMask ShowMask="true" />
    <BottomBar>
    <ext:PagingToolbar ID="PagingToolbar1" runat="server" />
    </BottomBar>
    </ext:GridPanel>
    </form>
    </body>
    </html>
    Last edited by geoffrey.mcgill; Sep 23, 2010 at 8:33 PM. Reason: please use [CODE] tags
  4. #4
    Please see Item #3 at the following location,

    http://forums.ext.net/showthread.php...ation-Required
    Last edited by geoffrey.mcgill; Sep 23, 2010 at 8:35 PM.
    Geoffrey McGill
    Founder
  5. #5
    <%@PageLanguage="C#" %>
    <%@RegisterAssembly="Ext.Net"Namespace="Ext.Net"TagPrefix="ext" %>
    <scriptrunat="server">
    protectedvoid Page_Load(object sender, EventArgs e)
    {
    if (!X.IsAjaxRequest)
    {
    this.BindData();
    }
    }
    protectedvoid MyData_Refresh(object sender, StoreRefreshDataEventArgs e)
    {
    this.BindData();
    }
    privatevoid BindData()
    {
     
    Store1.DataSource = this.Data;
    Store1.DataBind();
    }
     
     
     
    privateobject[] Data
    {
    get
    {
    DateTime now = DateTime.Now;
    returnnewobject[]
    {
    newobject[] { "3m Co", 71.72, 0.02, 0.03, now },
    newobject[] { "Alcoa Inc", 29.01, 0.42, 1.47, now },
    newobject[] { "Altria Group Inc", 83.81, 0.28, 0.34, now },
    newobject[] { "American Express Company", 52.55, 0.01, 0.02, now },
    newobject[] { "American International Group, Inc.", 64.13, 0.31, 0.49, now },
    newobject[] { "AT&T Inc.", 31.61, -0.48, -1.54, now },
    newobject[] { "Boeing Co.", 75.43, 0.53, 0.71, now },newobject[] { "Caterpillar Inc.", 67.27, 0.92, 1.39, now }, newobject[] { "Citigroup, Inc.", 49.37, 0.02, 0.04, now }, newobject[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, now }, newobject[] { "Exxon Mobil Corp", 68.1, -0.43, -0.64, now }, newobject[] { "General Electric Company", 34.14, -0.08, -0.23, now }, newobject[] { "General Motors Corporation", 30.27, 1.09, 3.74, now }, newobject[] { "Hewlett-Packard Co.", 36.53, -0.03, -0.08, now }, newobject[] { "Honeywell Intl Inc", 38.77, 0.05, 0.13, now }, newobject[] { "Intel Corporation", 19.88, 0.31, 1.58, now }, newobject[] { "International Business Machines", 81.41, 0.44, 0.54, now }, newobject[] { "Johnson & Johnson", 64.72, 0.06, 0.09, now }, newobject[] { "JP Morgan & Chase & Co", 45.73, 0.07, 0.15, now }, newobject[] { "McDonald\"s Corporation", 36.76, 0.86, 2.40, now }, newobject[] { "Merck & Co., Inc.", 40.96, 0.41, 1.01, now }, newobject[] { "Microsoft Corporation", 25.84, 0.14, 0.54, now }, newobject[] { "Pfizer Inc", 27.96, 0.4, 1.45, now }, newobject[] { "The Coca-Cola Company", 45.07, 0.26, 0.58, now }, newobject[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now }, newobject[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now }, newobject[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now }, newobject[] { "Verizon Communications", 35.57, 0.39, 1.11, now }, newobject[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now } };
    }
    } </script>
    <!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">
    <title>Ext.NET Example</title>
    </head>
    <body>
    <formid="Form1"runat="server">
    <ext:ResourceManagerID="ResourceManager1"runat="server"/>
     
     
    <ext:ButtonID="Button1"runat="server"Text="Button #1">
    <Listeners>
    <ClickHandler="Store1.reload()"/>
    </Listeners>
    </ext:Button>
     
     
    <ext:GridPanelID="GridPanel1"runat="server"StripeRows="true"Title="Array Grid"
    Width="600"Height="290"AutoExpandColumn="Company"SelectionMemory="Enabled">
    <Store>
    <ext:StoreID="Store1"runat="server"OnRefreshData="MyData_Refresh">
    <Reader>
    <ext:ArrayReaderIDProperty="company">
    <Fields>
    <ext:RecordFieldName="company"/>
    <ext:RecordFieldName="price"Type="Float"/>
    <ext:RecordFieldName="change"Type="Float"/>
    <ext:RecordFieldName="pctChange"Type="Float"/>
    <ext:RecordFieldName="lastChange"Type="Date"/>
    </Fields>
    </ext:ArrayReader>
    </Reader>
    </ext:Store>
    </Store>
    <ColumnModelID="ColumnModel1"runat="server">
    <Columns>
    <ext:RowNumbererColumn/>
    <ext:ColumnColumnID="Company"Header="Company"Width="160"DataIndex="company"/>
    <ext:ColumnHeader="Price"Width="75"DataIndex="price"/>
    <ext:ColumnHeader="Change"Width="75"DataIndex="change"/>
    <ext:ColumnHeader="Change"Width="75"DataIndex="pctChange"/>
    <ext:DateColumnHeader="Last Updated"Width="85"DataIndex="lastChange"Format="H:mm:ss"/>
    </Columns>
    </ColumnModel>
    <SelectionModel>
    <ext:RowSelectionModelID="RowSelectionModel1"runat="server"/>
    </SelectionModel>
    <LoadMaskShowMask="true"/>
    <BottomBar>
    <ext:PagingToolbarID="PagingToolbar1"runat="server"/>
    </BottomBar>
    </ext:GridPanel>
    </form>
    </body>
    </html>
  6. #6
    Please see Item #3 at the following location,

    http://forums.ext.net/showthread.php...ation-Required
    Last edited by geoffrey.mcgill; Sep 23, 2010 at 8:33 PM.
    Geoffrey McGill
    Founder
  7. #7
    Hi,

    GridPanel in your test sample maintains the selection after data reloaing.
    Please provide more details about your problem
  8. #8
    if the grid is not paginated is ok
    if the grid is paged, the page with the selected record is not setted
    this happens because you run the DataBind
    In my store you must update the client side without running DataBind server side.
    This is possible?
  9. #9
    Hi,

    Your sample code is still unreadable.
    But I tested again the sample code which is posted here

    http://forums.ext.net/showthread.php...ll=1#post40774

    And seems everything is ok with selections through paging.
    I select several rows on the first page, then select several rows on another page, click refresh and after that the selections are still there on both pages.

    In my store you must update the client side without running DataBind server side.
    This is possible?
    Please clarify what exactly do you mean under "update the client side"?
    Could you provide more details about the scenario do you need?

    Maybe just refreshing a GridPanel's view?
    If so, please see
    http://dev.sencha.com/deploy/dev/doc...member=refresh
  10. #10
    Hello why you say that my code is unreadable?
    I used the code tags. [CODE][/ CODE] .
    How do I indent?

    //remove the fifth item from the store
    Store1.removeAt(5);


    It 'can do the same thing for insert and update?

    I hope it is readable now
    the code is:


     
     
    <%@PageLanguage="C#" %>
    <%@RegisterAssembly="Ext.Net"Namespace="Ext.Net"TagPrefix="ext" %>
    <scriptrunat="server">
    protectedvoid Page_Load(object sender, EventArgs e) 
    { 
    if (!X.IsAjaxRequest)
    { 
    this.BindData(); 
    } 
    }
     
    protectedvoid MyData_Refresh(object sender, StoreRefreshDataEventArgs e)
    { 
    this.BindData();
    }
     
    privatevoid BindData() 
    { 
    Store1.DataSource = this.Data;
    Store1.DataBind();
    }
     
    privateobject[] Data 
    { 
    get
    { 
    DateTime now = DateTime.Now; 
    returnnewobject[] 
    { 
    newobject[] { "3m Co", 71.72, 0.02, 0.03, now }, 
    newobject[] { "Alcoa Inc", 29.01, 0.42, 1.47, now }, 
    newobject[] { "Altria Group Inc", 83.81, 0.28, 0.34, now }, 
    newobject[] { "American Express Company", 52.55, 0.01, 0.02, now }, 
    newobject[] { "American International Group, Inc.", 64.13, 0.31, 0.49, now }, 
    newobject[] { "AT&T Inc.", 31.61, -0.48, -1.54, now }, 
    newobject[] { "Boeing Co.", 75.43, 0.53, 0.71, now }, 
    newobject[] { "Caterpillar Inc.", 67.27, 0.92, 1.39, now }, 
    newobject[] { "Citigroup, Inc.", 49.37, 0.02, 0.04, now }, 
    newobject[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, now }, 
    newobject[] { "Exxon Mobil Corp", 68.1, -0.43, -0.64, now }, 
    newobject[] { "General Electric Company", 34.14, -0.08, -0.23, now }, 
    newobject[] { "General Motors Corporation", 30.27, 1.09, 3.74, now }, 
    newobject[] { "Hewlett-Packard Co.", 36.53, -0.03, -0.08, now }, 
    newobject[] { "Honeywell Intl Inc", 38.77, 0.05, 0.13, now }, 
    newobject[] { "Intel Corporation", 19.88, 0.31, 1.58, now }, 
    newobject[] { "International Business Machines", 81.41, 0.44, 0.54, now }, 
    newobject[] { "Johnson & Johnson", 64.72, 0.06, 0.09, now }, 
    newobject[] { "JP Morgan & Chase & Co", 45.73, 0.07, 0.15, now }, 
    newobject[] { "McDonald\"s Corporation", 36.76, 0.86, 2.40, now }, 
    newobject[] { "Merck & Co., Inc.", 40.96, 0.41, 1.01, now }, 
    newobject[] { "Microsoft Corporation", 25.84, 0.14, 0.54, now }, 
    newobject[] { "Pfizer Inc", 27.96, 0.4, 1.45, now }, 
    newobject[] { "The Coca-Cola Company", 45.07, 0.26, 0.58, now }, 
    newobject[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now }, 
    newobject[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now }, 
    newobject[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now }, 
    newobject[] { "Verizon Communications", 35.57, 0.39, 1.11, now }, 
    newobject[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now } }; } } 
     
    </script>
    <!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">
    <title>Ext.NET Example</title>
    </head>
    <body>
    <formid="Form1"runat="server">
    <ext:ResourceManagerID="ResourceManager1"runat="server"/>
    <ext:GridPanelID="GridPanel1"runat="server"StripeRows="true"Title="Array Grid"
    Width="600"Height="290"AutoExpandColumn="Company"SelectionMemory="Enabled">
    <Store>
    <ext:StoreID="Store1"runat="server"OnRefreshData="MyData_Refresh">
    <Reader>
    <ext:ArrayReaderIDProperty="company">
    <Fields>
    <ext:RecordFieldName="company"/>
    <ext:RecordFieldName="price"Type="Float"/>
    <ext:RecordFieldName="change"Type="Float"/>
    <ext:RecordFieldName="pctChange"Type="Float"/>
    <ext:RecordFieldName="lastChange"Type="Date"/>
    </Fields>
    </ext:ArrayReader>
    </Reader>
    </ext:Store>
    </Store>
    <ColumnModelID="ColumnModel1"runat="server">
    <Columns>
    <ext:RowNumbererColumn/>
    <ext:ColumnColumnID="Company"Header="Company"Width="160"DataIndex="company"/>
    <ext:ColumnHeader="Price"Width="75"DataIndex="price"/>
    <ext:ColumnHeader="Change"Width="75"DataIndex="change"/>
    <ext:ColumnHeader="Change"Width="75"DataIndex="pctChange"/>
    <ext:DateColumnHeader="Last Updated"Width="85"DataIndex="lastChange"Format="H:mm:ss"/>
    </Columns>
    </ColumnModel>
    <SelectionModel>
    <ext:RowSelectionModelID="RowSelectionModel"runat="server"SingleSelect="true">
     
    </ext:RowSelectionModel>
    </SelectionModel>
    <LoadMaskShowMask="true"/>
    <BottomBar>
    <ext:PagingToolbarID="PagingToolbar1"runat="server"/>
    </BottomBar>
    </ext:GridPanel>
     
    <ext:ButtonID="Button1"runat="server"Text="Delete the fifth record">
    <Listeners>
    <ClickHandler="Store1.removeAt(5);"/>
    </Listeners>
    </ext:Button>
     
    <ext:ButtonID="Button2"runat="server"Text="Update the fifth record">
    <Listeners>
    <ClickHandler="??"/>
    </Listeners>
    </ext:Button>
     
     
    <ext:ButtonID="Button3"runat="server"Text="Insert new record">
    <Listeners>
    <ClickHandler="??"/>
    </Listeners>
    </ext:Button>
    </form>
    </body>
    </html>
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: Sep 21, 2011, 11:56 AM
  2. Server side method to save Gridpanel
    By cpvaishya in forum 1.x Help
    Replies: 0
    Last Post: Jan 27, 2010, 1:09 AM
  3. Update grid from Server Side
    By Maia in forum 1.x Help
    Replies: 3
    Last Post: Jun 03, 2009, 2:21 PM
  4. Invoking Server side method
    By bobs in forum 1.x Help
    Replies: 2
    Last Post: May 08, 2009, 3:12 AM
  5. Update Store on Server Side
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Jan 14, 2009, 5:59 PM

Posting Permissions