[CLOSED] ComboBox.Items.Count shows '0', even after binding data the ComboBox store.

Threaded View

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

    [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 ================
     <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]

Similar Threads

  1. Data not binding into ComboBox
    By nagesh in forum 1.x Help
    Replies: 5
    Last Post: Jul 12, 2012, 2:35 PM
  2. Replies: 0
    Last Post: May 15, 2012, 5:22 PM
  3. Replies: 0
    Last Post: Oct 25, 2011, 10:02 AM
  4. Count items in a ComboBox?
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Nov 18, 2009, 11:25 AM
  5. Two binding combobox not work by items way
    By animalisme in forum 1.x Help
    Replies: 1
    Last Post: Sep 28, 2009, 3:30 AM

Tags for this Thread

Posting Permissions