[CLOSED] Combobox in CodeBehind

  1. #1

    [CLOSED] Combobox in CodeBehind

    Hi,

    I have a problem with Combobox in CodeBehind.
    When I have two properties InputWidth and PreserveIndicatorIcon, I can not click to dropdownlist to display the list of items.
    Here is mys test: (I use Ext.net 2.x /truck revision 5252)

    Controller:
    public class TestController : Controller
        {
            public ActionResult Index()
            {
                var combo_box = new ComboBox
                                {
                                    InputWidth = 200,
                                    FieldLabel = "Test",
                                    ReadOnly = false,
                                    IndicatorIcon = Icon.Accept,
                                    AllowBlank = false,
                                    PreserveIndicatorIcon = true,
                                };
                combo_box.Items.Add(new ListItem("test", "test"));
                combo_box.Items.Add(new ListItem("test2", "test2"));
                return View(combo_box);
            }
        }
    View:
    @model dynamic
    
    @{ Layout = null;}
    
    @Html.X().ResourceManager()
    
    @(Html.X().FieldSet().Title("Test").Width(600).Height(700)
    .Items(Model))
    Do you have any idea for this problem?

    Thank you,
    Last edited by Daniil; Jul 15, 2013 at 4:12 PM. Reason: [CLOSED]
  2. #2
    Hi @UnifyEducation,

    The arrow down and accept icons overlap, right? Yes, I can reproduce it with v2.2 release, but cannot reproduce with the trunk. So, it has been fixed. Please update from the SVN trunk.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @UnifyEducation,

    The arrow down and accept icons overlap, right? Yes, I can reproduce it with v2.2 release, but cannot reproduce with the trunk. So, it has been fixed. Please update from the SVN trunk.
    Thanks you for your help. I retest with /truck revision 5252 with a small change (I remove PreserveIndicatorIcon = true properties), but the problem returns. The reason that I use PreserveIndicatorIcon=true is: I have a list of dynamic combobox, some has indicator, some other hasn't indicator, and I want they have the same width.

    public class TestController : Controller
        {
            public ActionResult Index()
            {
                var combo_box = new ComboBox
                                {
                                    InputWidth = 200,
                                    FieldLabel = "Test",
                                    ReadOnly = false,
                                    IndicatorIcon = Icon.Accept,
                                    AllowBlank = false,
                                };
                combo_box.Items.Add(new ListItem("test", "test"));
                combo_box.Items.Add(new ListItem("test2", "test2"));
                return View(combo_box);
            }
        }
  4. #4
    I was able to reproduce the issue (reproduced if set PreserveIndicatorIcon=true and remove IndicatorIcon)
    Fixed in SVN
  5. #5
    Quote Originally Posted by Vladimir View Post
    I was able to reproduce the issue (reproduced if set PreserveIndicatorIcon=true and remove IndicatorIcon)
    Fixed in SVN
    Thank you. You can close this thread. :-)

Similar Threads

  1. Replies: 3
    Last Post: May 29, 2013, 12:31 PM
  2. [CLOSED] Can't add ListItems to ComboBox in codebehind [1.0]
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 18, 2012, 5:05 PM
  3. [CLOSED] How to set InitialValue of ComboBox from codebehind
    By xeo4.it in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 26, 2010, 9:46 AM
  4. Dynamic Combobox in codebehind
    By ljankowski in forum 1.x Help
    Replies: 1
    Last Post: Dec 03, 2009, 2:54 PM
  5. Add TemplateControl to ComboBox in codebehind?
    By plykkegaard in forum 1.x Help
    Replies: 2
    Last Post: Aug 13, 2009, 9:12 AM

Posting Permissions