I cant get the igCombo to show the dropdown button
it is there but grey
@{IEnumerable<Intranet.mvc.Models.Status> List = ViewBag.Status;}@(Html.Infragistics().ComboFor(m => m.Status).TextKey("Status1").TextKeyType(ComboDataType.String).ValueKey("ID").ValueKeyType(ComboDataType.Number).DropDownOnFocus(true).Mode(ComboMode.DropDown).ShowDropDownButton(true).ValidatorOptions(option => option.Required(true)).DataSource(List).DataBind().Render())
Hi Christian,
It's probably something with the resources, because I've copy/pasted your code on my side and it's working just fine.
Can you sent us your solution so we can check if everything is ok with your references. Or at least isolated sample (we don't need your business data of course)
Thanks,
The code in the browser look like this
<span id="Arrangementet.Omvisning"><input name="Arrangementet.Omvisning" type="hidden" /></span><script type="text/javascript">//<!--<![CDATA[$(function () {$('#Arrangementet\\.Omvisning').igCombo({ filterExprUrlKey: 'filter', selectedItems: [{value:0}], textKey: 'OmvisType', textKeyType: 'string', valueKey: 'ID', valueKeyType: 'number', dropDownOnFocus: true, mode: 'dropdown', showDropDownButton: true, inputName: 'Arrangementet.Omvisning', loadOnDemandSettings: null, dataSource: [{"OmvisType":"Ingen","ID":0},{"OmvisType":"ARoS","ID":1},{"OmvisType":"ARoS mini","ID":2},{"OmvisType":"Kunst","ID":3},{"OmvisType":"Særudstilling","ID":4}] });});//]]>--></script>
It's weird.
On first sight your implementation seems fine to me. Any errors inside the browser console? Have you checked the script tag which is injected to instantiate igCombo?
I have tried this but no luck
List<OmvisningsTyper> lstOmvisninger = new List<OmvisningsTyper>();lstOmvisninger.Add(new OmvisningsTyper { ID = 0, OmvisType = "Ingen" });lstOmvisninger.Add(new OmvisningsTyper { ID = 1, OmvisType = "ARoS" });lstOmvisninger.Add(new OmvisningsTyper { ID = 2, OmvisType = "ARoS mini" });lstOmvisninger.Add(new OmvisningsTyper { ID = 3, OmvisType = "Kunst" });lstOmvisninger.Add(new OmvisningsTyper { ID = 4, OmvisType = "Særudstilling" });ViewBag.OmvisningsTyper = lstOmvisninger.AsEnumerable();
@{IEnumerable<Intranet.mvc.Models.OmvisningsTyper> oList = ViewBag.OmvisningsTyper;}@(Html.Infragistics().ComboFor(m => m.Omvisning).TextKey("OmvisType").TextKeyType(ComboDataType.String).ValueKey("ID").ValueKeyType(ComboDataType.Number).DropDownOnFocus(true).Mode(ComboMode.DropDown).ShowDropDownButton(true).DataSource(oList).DataBind().Render())
I'm reusing your code to instantiate the combo with the following code inside the Controller
private IEnumerable<Customer> GetCustomers()
{
return new List<Customer>
new Customer { ID=1, Name="John Smith", IsActive=true },
new Customer { ID=2, Name="Bob Richards", IsActive=false },
new Customer { ID=3, Name="Marge Wright", IsActive=false },
new Customer { ID=4, Name="Dwight Long", IsActive=true },
new Customer { ID=5, Name="Amy Grant", IsActive=true },
};
}
If you have similar code and you have the result assigned to a variable Status in your ViewBag, Than I'll suggest you to check (vie some browser debbuger - Firebud, Dev tools etc. ) the generated igCombo script. And more specific the dataSource property - in your case it should contain all the data from your List of Status, but in JSON format. If it's not there then the problem is in the Data Serialization between you Controller and your View.