Mar 11, 2013, 8:28 AM
[CLOSED] ComboBox.Items.Count shows '0', even after binding data the ComboBox store.
Team,
I have a combobox which is has store mapped to it.
I am binding the data to the store in page_load event, after that i have to select the first item in that combobox, but when i check the item count it shows 0, so i am not able to select the items.
Here below the code snippet.
=========== aspx ================
=========== code behind =========
Please help me in resolving this.
Thanks in advance.
Cheers...
I have a combobox which is has store mapped to it.
I am binding the data to the store in page_load event, after that i have to select the first item in that combobox, but when i check the item count it shows 0, so i am not able to select the items.
Here below the code snippet.
=========== aspx ================
<ext:Store ID="storeFilterSites" runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="SITE_NAME" />
<ext:ModelField Name="SITE_QUERY_ID" />
<ext:ModelField Name="ONNET_FLAG" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:ComboBox ID="cmbSiteFilter" MarginSpec="1 5 0 5" runat="server" StoreID="storeFilterSites"
DisplayField="SITE_NAME" TriggerAction="All" ValueField="SITE_QUERY_ID" QueryMode="Remote"
ForceSelection="true" Editable="false" EmptyText="Please Select">
<ListConfig ItemSelector="div.list-item">
<Tpl ID="Tpl3" runat="server">
<Html>
<tpl for=".">
<div class="list-item">
{SITE_NAME}
</div>
</tpl>
</Html>
</Tpl>
</ListConfig>
</ext:ComboBox>
======================================= code behind =========
DataTable dtSiteData = objBAL.GetSiteList(requestId);
storeFilterSites.DataSource = dtSiteData;
storeFilterSites.DataBind();
//in the below statement, the count is alway zero.
if (cmbSiteFilter.Items.Count > 0)
{
cmbSiteFilter.Select(0);
}
============================Please help me in resolving this.
Thanks in advance.
Cheers...
Last edited by Baidaly; Mar 15, 2013 at 4:04 AM.
Reason: [CLOSED]