Autosave dynamic created gridpanel with store

  1. #1

    Autosave dynamic created gridpanel with store

    Hi,

    I'm trying to get autosave to work on my store of my code-behind created gridpanel. But I'm getting an error. This is my piece of code:

    Exception Details: System.Web.HttpException: The control with ID 'ctl287' is not IPostBackEventHandler

    Created 5 gridpanels on Page_Load:
    
                foreach (var Specificatie in AlleSpecificaties)
                {
                   
                    // gridpanel
                    var GridPanelSpecificatie = new GridPanel
                    {
                        ID = "GridPanelSpecificatie_" + Specificatie.Id,
                        Layout = "FitLayout",
                        Flex = 1,
                        ColumnLines = true,
                        RowLines = true,
                        AutoScroll = true,
                        Store = {
                            new Store{
                                AutoSync = true,
                                Model = {
                                    new Model{
                                        Name = "Specificatie_" + Specificatie.Id,
                                        IDProperty = "Id",
                                        Fields = {
                                            new ModelField{
                                                Name = "Id",
                                                Type = ModelFieldType.Int,
                                                UseNull = true
                                            },
                                            new ModelField{
                                                Name = "Naam"
                                            }
                                        }
                                    }
                                },
                                DataSource = Specificatie.SpecificatieItems.Where(x => x.Verwijderd == false).ToList()
                            }
                        },
                        Plugins = {
                            new CellEditing()
                        },
                        ColumnModel =
                        {
                            Columns = {
                                new CommandColumn{
                                    Width= 40,
                                    Align = Alignment.Center,
                                    OverOnly = true,
                                    Commands = {
                                        new CommandFill(),
                                        new GridCommand{
                                            Icon = Icon.Cancel,
                                            CommandName = "Delete",
                                            StandOut = true
                                        },
                                        new CommandFill()
                                    },
                                    Listeners = {
                                        Command = {
                                            Handler = "#{GridPanelSpecificatie_" + Specificatie.Id + "}.getStore().remove(record);"
                                        }
                                    }
                                },
                                new Column {
                                    DataIndex = "Naam",
                                    Flex = 1,
                                    Border = false,
                                    Editor = {
                                        new TextField{
                                            AllowBlank = false,
                                            CausesValidation = true
                                        }
                                    }
                                }
                            }
                        },
                        SelectionModel = {
                            new CheckboxSelectionModel {
                                ID = "CheckboxSelectionModel_GridPanelSpecificatie_" + Specificatie.Id
    
                                //Listeners = {
                                //    SelectionChange = {
                                //        Fn = "GridPanelSpecificatie_SelectionChange"
                                //    }
                                //}
                            }
                        }
                    };
    
                    // event
                    GridPanelSpecificatie.GetStore().BeforeStoreChanged += GridSpecificatie_BeforeChanged;
    
                    PanelSpecificatie.Items.Add(GridPanelSpecificatie);
    Last edited by Nesse; Dec 07, 2012 at 11:41 AM.
  2. #2
    I've tried for the last 2 days, but still without success. Should i search for another approach?

    Kind regards

Similar Threads

  1. Replies: 1
    Last Post: Apr 13, 2012, 1:52 PM
  2. Store AutoSave
    By cwolcott in forum 1.x Help
    Replies: 5
    Last Post: Jan 09, 2012, 11:26 PM
  3. Replies: 0
    Last Post: Mar 04, 2011, 12:05 PM
  4. [CLOSED] autosave on gridpanel
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 08, 2011, 2:42 PM
  5. [CLOSED] Dynamcally created Combox and its Dynamic Store
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 21, 2011, 4:10 PM

Tags for this Thread

Posting Permissions