Create Grid Panel Editor in Code Behind

  1. #1

    Create Grid Panel Editor in Code Behind

    Hi,

    I am trying to create a gridpanel and associated column editors within code behind. Howerver I get a javascript error in during the page rendering.
    If I don't bind the combobox editor to the data, the page renders completely. However if I try to bind the data, the page gets stuck and then eventually a javascript error appers on IE.

    In case it's helpful here is the error IE is giving:
    Message: Syntax error
    Line: 266
    Char: 134
    Code: 0
    URI: http://MyPage.com/MySite/extnet/extn...xt.axd?v=37522

    
                GridPanel grid = new GridPanel();
                grid.ID = "mygrid";
                grid.ClientIDMode = ClientIDMode.Static;
                grid.Store.Add(store);                    //populated using HttpProxy
                grid.ColumnModel.Columns.AddRange(colCollection);
                grid.SelectionModel.Add(new RowSelectionModel() { SingleSelect = true });
    
                //add editors
                grid.ColumnModel.Columns[0].Editor.Add(new TextField() { AllowBlank = true });
    
                ExtJS.JsonReader rdrCRD= new ExtJS.JsonReader();
                rdrCRD.Fields.Clear();
                foreach (PropertyInfo pi in oProps)
                {
                    rdrCRD.Fields.Add(pi.Name);
                }
    
                Store storeCRD = new Store
                {
                    AutoLoad=false, RemoteSort = false
                };
                storeCRDRatings.Reader.Add(rdrCRD);
    
                ComboBox cbEd = new ComboBox
                {
                    TypeAhead = true,
                    Mode = DataLoadMode.Local,
                    DisplayField = "FLD",
                    ValueField = "FLD",
                    EmptyText = "Loading...",
                    Width = Unit.Pixel(250),
                    AutoRender=false
                };
                cbEd.Store.Add(storeCRD);
                storeCRDRatings.DataSource = DataRepository.GetDATA(cbRating.SelectedItem.Value); //repository returns a List<T>
                storeCRDRatings.DataBind();
    
                grid.ColumnModel.Columns[1].Editor.Add(cbEd);
    I appreciate your help.
    Thank you.
  2. #2
    Sorry, here is the IE error page .
    "MyPage.com/MySite/extnet/extnet-core-js/ext.axd?v=37522"
  3. #3
    I figured it out. Just need to assign id to combobox store in code behind.

Similar Threads

  1. [CLOSED] Grid Panel Editor Focus Problem
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 07, 2010, 11:55 AM
  2. [CLOSED] Grid Panel editor combobox default value
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 08, 2009, 8:38 AM
  3. Grid Panel SetValue of editor field
    By domibo in forum 1.x Help
    Replies: 0
    Last Post: Sep 23, 2009, 10:35 AM
  4. [CLOSED] Focus in Textfield in Grid Panel Editor
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Aug 24, 2009, 5:07 AM
  5. [CLOSED] Grid panel editor
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 13, 2009, 7:48 AM

Tags for this Thread

Posting Permissions