Jan 09, 2014, 5:13 AM
How to get dynamically added ComboBox values.
Hi,
am adding Combobox using direct events
this is my code behind
this is the code am using.
can any one help me..how to get dynamically added combobox values in direct events
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.