[CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

  1. #1

    [CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

    Hi,

    I am using the Icon comboBox. When I run the application it looks fine, every icon is with its item and when select an item it shows the selected item with the icon.

    The problem that I found is when a set a default value to the item selected when the page is loaded. It shows just the text but not the Icon.


    
    
    
    protected void Page_Load(object sender, EventArgs e)
    
    
    {
    
    
        if (!X.IsAjaxRequest)
    
    
        {
    
    
            createLanguagesDataSource();
    
    
    
            this.ComboBoxLanguages.SelectedItem.Value = "en-US";
    
    
        }
    
    
    
    
    
    }
    
    
    
    
    protected void createLanguagesDataSource()
    
    
    {
    
    
        this.StoreLanguages.DataSource = new object[]
    
    
        {
    
    
            new object[] { ResourceManager.GetIconClassName(Icon.FlagUs), "English", "en-US"},
    
    
            new object[] { ResourceManager.GetIconClassName(Icon.FlagEs), "Spanish", "es-CO"}
    
    
        };
    
    
        this.StoreLanguages.DataBind();
    
    
        ResourceManager1.RegisterIcon(Icon.FlagUs);
    
    
        ResourceManager1.RegisterIcon(Icon.FlagEs);
    
    
    }
    
    
    
    <ext:Store ID="StoreLanguages" runat="server">
    
    
        <Reader>
    
    
            <ext:ArrayReader>
    
    
                <Fields>
    
    
                <ext:RecordField Name="iconCls" />
    
    
                <ext:RecordField Name="name" />
    
    
                <ext:RecordField Name="culture" />
    
    
            </Fields>
    
    
        </ext:ArrayReader>
    
    
        </Reader> 
    
    
    </ext:Store>
    
    
    
    
    <ext:ComboBox 
    
    
    ID="ComboBoxLanguages" 
    
    
    runat="server"
    
    
    StoreID="StoreLanguages" 
    
    
    Width="100px"
    
    
    Editable="false"
    
    
    DisplayField="name"
    
    
    ValueField="culture"
    
    
    Mode="Local"
    
    
    TriggerAction="All"
    
    
    EmptyText="Language">
    
    
    <Template ID="Template1" runat="server">
    
    
    <Html>
    
    
    <tpl for=".">
    
    
    <div class="x-combo-list-item icon-combo-item {iconCls}">
    
    
    {name}
    
    
    
    
    
    
    </tpl>
    
    
    </Html>
    
    
    </Template> 
    
    
    <Listeners>
    
    
    <Select Handler="this.setIconCls(record.get('iconCls'));" />
    
    
    </Listeners> 
    
    
    <DirectEvents>
    
    
    <Select OnEvent="ComboBoxLanguagesSelect"/>
    
    
    </DirectEvents>
    
    
    </ext:ComboBox>
  2. #2

    RE: [CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

    Hi,

    You have to define value for the Icon property. Please note that Icon doesn't automatically set on item selection therefore you have to set icon manually always
  3. #3

    RE: [CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

    Hi,

    I am not sure how to do that by code behind, could you help me please?


  4. #4

    RE: [CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

    Hi,

    Combo1.Icon = Icon.FlagUs;
  5. #5

    RE: [CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

    I created a new post by mistake instead of reply here <A href="http://forums.ext.net/showthread.php?threadid=28733-16-1.aspx">

    http://forums.ext.net/showthread.php?threadid=28733-16-1.aspx</A>
  6. #6

    RE: [CLOSED] Icon ComboBox does not show the icon when the item slected value is setted by code?

    Hi,

    Fixed. Please update from SVN

Similar Threads

  1. Replies: 5
    Last Post: Aug 02, 2010, 8:44 AM
  2. Replies: 3
    Last Post: Jul 20, 2010, 7:48 PM
  3. Replies: 1
    Last Post: Jun 04, 2010, 5:21 PM
  4. Replies: 0
    Last Post: May 04, 2010, 7:08 AM
  5. Replies: 2
    Last Post: Mar 04, 2010, 7:12 PM

Posting Permissions