Inserting item in a ComboBox that has a Store not working

  1. #1

    Cannot insert an item manually in a ComboBox if it is connected to a Store

    Hi everyone, when I'm using plain ASP.NET controls I use the AfterDataBound event of the control to insert a new item on the ComboBox that is usually the "Select All" item, for the instance in a ComboBox with a list of "accounts" I insert an item at index 0 with the text "all accounts", very well, I would like to to the same with an Ext.Net ComboBox, me code is below, it inserts a blank item on the combo, not sure why, could you please check? My combobox is linked to a <Ext:Store> that is linked to an <asp:SqlDataSource>.
    Thanks!

    <ext:ComboBox ID="cmbAccounts" runat="server" FieldLabel="Payees" Mode="Local" StoreID="StoreAccounts"
                            AllowBlank="false" DisplayField="Name" ValueField="ID" AutoDataBind="true" AnchorHorizontal="100%">
                            <DirectEvents>
                                <Added OnEvent="AccountsDataBinded"></Added>
                            </DirectEvents>
                        </ext:ComboBox>
    protected void AccountsDataBinded(object sender, DirectEventArgs e)
        {
            Dictionary<string, object> values = new Dictionary<string, object>(2);
            values.Add("All Accounts", "All Accounts");
    
            this.cmbAccounts.InsertRecord(0, values);
            this.cmbAccounts.SelectedItem.Value = "All Accounts";
        }
    Last edited by paul-2011; Sep 22, 2010 at 3:51 AM.

Similar Threads

  1. Replies: 3
    Last Post: Nov 05, 2013, 9:34 AM
  2. Replies: 2
    Last Post: Jan 17, 2011, 3:02 PM
  3. Replies: 1
    Last Post: Aug 12, 2009, 11:39 AM
  4. Inserting a blank value into combobox
    By FreddieBoo in forum 1.x Help
    Replies: 1
    Last Post: May 26, 2009, 9:19 AM
  5. Replies: 7
    Last Post: Nov 12, 2008, 9:53 PM

Posting Permissions