Oct 20, 2015, 7:41 AM
[CLOSED] Combobox can't get value when add list item using code behind
This code for insert value into cboRegional
thanks
public List<PropertyFinance> obj = PropertyFinanceItemItem.GetDataAll();
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest)
{
List<Ext.Net.ListItem> licol = new List<Ext.Net.ListItem>();
var cboObj = obj.Select(x => x.KODE_REGIONAL).Distinct().OrderBy(x => x);
foreach (var item in cboObj)
{
licol.Add(new Ext.Net.ListItem(item, item));
}
licol.Insert(0, new Ext.Net.ListItem("All", "All"));
cboRegional.Items.AddRange(licol);
cboRegional.Value = "All";
} }protected void GHRefresh(object sender, StoreReadDataEventArgs e)
{
string xyz = this.cboRegional.SelectedItem.Text; // result = null
xyz = this.cboRegional.Text; // result =''
}
how to get value string of cboRegional?thanks
Last edited by Daniil; Oct 21, 2015 at 8:35 AM.
Reason: Please use [CODE] tags, [CLOSED]