Dynamic tabs

  1. #1

    Dynamic tabs

    Hi,

    I need to dynamically add tabs in grid. while compiling i'm not getting any syntax error. I'm getting syntax error during runtime. any comments?
    Last edited by Aswini Ladish; Dec 19, 2012 at 11:37 AM. Reason: removing the code
  2. #2

    Dunamic tabs

    Here is the code

    DataTable dtable = new DataTable();
    
    
            protected void Page_Load(object sender, EventArgs e)
            {
                CreateDataTable();
               
                JsonReader jr = new JsonReader();
    
                Store store = new Store()
                {
                    ID = "Store1",
                    Reader = { jr }
                };
    
    
                TabPanel tp = new TabPanel()
                {
                    ID = "TabPanel1",
    
                    Height = Unit.Pixel(500),
                    Width = Unit.Pixel(500)
                };
                GridPanel gp = new GridPanel()
                {
                    ID = "GridPanel1",
                    Width = Unit.Pixel(500),
                    Height = Unit.Pixel(500),
                    Closable = true,
                    Store = { store }
    
                };
    
                GridPanel gp1 = new GridPanel()
                {
                    ID = "GridPanel2",
                    Width = Unit.Pixel(500),
                    Height = Unit.Pixel(500),
                    Closable = true,
                    Store = { store }
    
                };
                
                Ext.Net.Panel panel1 = new Ext.Net.Panel();
                panel1.ID = "Tab1";
                panel1.Title = "Tab1";
                panel1.Html = "Tab1";
                panel1.Closable = true;
                panel1.Items.Add(gp);
                tp.Items.Add(panel1);
    
                foreach (DataColumn col in dtable.Columns)
                {
                    jr.Fields.Add(col.ColumnName);
                    gp.ColumnModel.Columns.Add(new Column { Header = col.ColumnName, DataIndex = col.ColumnName });
                }
                store.DataSource = dtable;
                store.DataBind();
    
    
                Ext.Net.Panel panel2 = new Ext.Net.Panel();
                panel2.ID = "Tab2";
                panel2.Title = "Tab2";
                panel2.Html = "Tab2";
                panel2.Closable = true;
                panel2.Items.Add(gp1);
                tp.Items.Add(panel2);
    
                foreach (DataColumn col in dtable.Columns)
                {
                    jr.Fields.Add(col.ColumnName);
                    gp1.ColumnModel.Columns.Add(new Column { Header = col.ColumnName, DataIndex = col.ColumnName });
                }
                store.DataSource = dtable;
                store.DataBind();
                
                this.Form.Controls.Add(tp);
    
            }
    
    
    Below is Createtable method
    
     public void CreateDataTable()
            {
    
                dtable.TableName = "Supplier";
                dtable.Columns.Add("Supplier Name");
                dtable.Columns.Add("Zone ID");
                dtable.Columns.Add("Zone Name");
                dtable.Columns.Add("Country");
                dtable.Columns.Add("Country ID");
    
                dtable.Rows.Add("O2", "zone1", "Edinburgh", "UK", "UK");
                dtable.Rows.Add("Vodafone", "Zone2", "Bangalore", "India", "IND");
                dtable.Rows.Add("Airtel", "Zone2", "Delhi", "India", "IND");
                dtable.Rows.Add("Orange", "Zone2", "Cardiff Bay", "UK", "UK");
                dtable.Rows.Add("Core", "Zone3", "Derby", "UK", "UK");
                dtable.Rows.Add("O2", "Zone1", "Newyork", "USA", "USA");
                dtable.Rows.Add("Orange", "Zone2", "Chicago", "USA", "USA");
    
            }
    Last edited by geoffrey.mcgill; Dec 19, 2012 at 12:44 PM. Reason: please use [CODE] tags
  3. #3
    Hi,

    Please someone respond to this thread? this is very urgent.

Similar Threads

  1. [CLOSED] Move tabs Tabs Style Google Chrome
    By majunior in forum 1.x Premium Help
    Replies: 7
    Last Post: Apr 30, 2013, 1:58 PM
  2. [CLOSED] Advice for dynamic multiple tabs
    By mattwoberts in forum 1.x Premium Help
    Replies: 3
    Last Post: Aug 04, 2011, 11:18 AM
  3. [CLOSED] dynamic tabs do not display content
    By alexp in forum 1.x Premium Help
    Replies: 3
    Last Post: May 07, 2009, 2:05 AM
  4. [CLOSED] Dynamic Tabs and Containerlayout
    By iwen in forum 1.x Premium Help
    Replies: 2
    Last Post: Dec 31, 2008, 11:14 AM
  5. Adding dynamic tabs on ext button click.
    By prashobkumar in forum 1.x Help
    Replies: 2
    Last Post: Dec 07, 2008, 12:25 PM

Posting Permissions