ComboBox stays open after Select Direct Event

  1. #1

    ComboBox stays open after Select Direct Event

    Any help would be appreciated. The ComboBox looks as though it's collapsed, but if I roll over it without opening another ComboBox it opens again and fires Page_Load (originally I had it selecting the first element there, but had to take that out as rolling over the ComboBox again would reset the value and call select, changing the values in my Departments combo). I'm guessing that I just need one call for the event handler, but I have no idea what that one call would be.

    The handler will eventually just apply a filter to DptStore but I haven't looked in to that enough yet to figure out how to get it working properly.

    <ext:ComboBox ID="FacCombo" runat="server" StoreID="FacStore" allowBlank="false" Name="fac" DisplayField="facility1" ValueField="facility_no" Editable="false" FieldLabel="Facility" ForceSelection="True" AnchorHorizontal="100%" >
       <DirectEvents>
          <Select OnEvent="updateDepartments" />
       </DirectEvents>
    </ext:ComboBox>
    The C# code in the code-behind is:

    protected void updateDepartments(object sender, DirectEventArgs e)
    {
        DataDataContext db = new DataDataContext();
    
        String fac_no = FacCombo.SelectedItem.Value;
    
        var dpt = from d in db.departments
                  where (d.facility_no.ToString().Equals(fac_no))
                  select d;
    
        this.DptStore.LoadData(dpt.ToList());
        this.DptStore.DataBind();
    }
  2. #2
    I guess that you rebind combo's store each request, try to wrap data binding by 'if(!X.IsAjaxRequest)'
  3. #3
    That was the solution. Thank you very much!

Similar Threads

  1. Replies: 4
    Last Post: Jul 12, 2012, 2:29 PM
  2. [CLOSED] Combobox Direct Event
    By Sevilay Tanış in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 24, 2012, 12:54 PM
  3. Replies: 0
    Last Post: Oct 05, 2011, 9:48 AM
  4. Replies: 5
    Last Post: Sep 19, 2011, 8:20 PM
  5. ComboBox Multiple select event issue
    By hardik in forum 1.x Help
    Replies: 3
    Last Post: May 21, 2011, 11:16 AM

Posting Permissions