PDA

View Full Version : [CLOSED] Combobox in CodeBehind



UnifyEducation
Jul 15, 2013, 10:20 AM
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,

Daniil
Jul 15, 2013, 11:12 AM
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.

UnifyEducation
Jul 15, 2013, 2:05 PM
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);
}
}

Vladimir
Jul 15, 2013, 2:36 PM
I was able to reproduce the issue (reproduced if set PreserveIndicatorIcon=true and remove IndicatorIcon)
Fixed in SVN

UnifyEducation
Jul 15, 2013, 5:06 PM
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. :-)