How to get dynamically added ComboBox values.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    How to get dynamically added ComboBox values.

    Hi,

    am adding Combobox using direct events
    this is my code behind
     protected void Add_Click(object sender, DirectEventArgs e)
        {
            Container container = new Container()
             {
                 ID = "Cont1",
                 Layout = "ColumnLayout",
                 MarginSpec = "10 10 0 0"
             };
    
            Ext.Net.ComboBox combo = new Ext.Net.ComboBox();
    
            combo.ID = "Parameter";
            combo.ColumnWidth = 0.465;
            combo.IndicatorText = "*";
            combo.IndicatorCls = "red-text";
            combo.ValueField = "ID";
            combo.DisplayField = "VALUE";
            combo.FieldLabel = "Row2";
            combo.EmptyText = "Select Template Type";
    
            container.Items.Add(combo);
    
    
            DataSet ds = new DataSet();
            ds = new DataSet();
            List<object> data = new List<object>();
    
            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
            {
                combo.Items.Add(new Ext.Net.ListItem(ds.Tables[0].Rows[i]["name"].ToString(), Convert.ToInt32(ds.Tables[0].Rows[i]["ID"])));
            }
    
            Container1.Items.Add(container);
            FieldSet1.UpdateContent();
        }
    but while i reading all page controls i could not able to get this combobox values.

    this is the code am using.

     protected void Save_Click(object sender, DirectEventArgs e)
        {
            Control form = new Control();
            ResetAllControls(form);
        }
    
        public void ResetAllControls(Control form)
        {
            foreach (Ext.Net.ComboBox combo in ControlUtils.FindControls<Ext.Net.ComboBox>(this.Page))
            {
                var x = combo.SelectedItem.Value;
            }
        }

    can any one help me..how to get dynamically added combobox values in direct events
    Last edited by antoreegan; Jan 09, 2014 at 5:17 AM.

Similar Threads

  1. [CLOSED] ComboBox added values are not showing.
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 29, 2013, 12:45 PM
  2. Replies: 3
    Last Post: Feb 21, 2012, 6:40 AM
  3. dynamically added image and getOriginalSize()
    By bakardi in forum 1.x Help
    Replies: 1
    Last Post: Nov 15, 2010, 4:38 PM
  4. Replies: 5
    Last Post: Aug 02, 2010, 12:30 PM
  5. Populate value of dynamically added control
    By danielg in forum 1.x Help
    Replies: 0
    Last Post: Feb 09, 2009, 12:53 PM

Posting Permissions