Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
Ignite ui combobox with mvc 4.0 helpers load from database error
posted

i am trying to use a ignite ui componet called combobox , and i was trying to follow this tutorial on the igniteui page.

heres is the link:
<http://www.igniteui.com/combo/aspnet-mvc-helper>

the tutorial uses a repository factory, and i am using entity framework model with linq.
i already use some of the components of ignite ui, like igGrid, and i followed the tutorial on this video

<http://es.infragistics.com/products/jquery/grid/videos/iggrid-entity-framework-model>
to make the grid bind with ef model.

I am having problems with the binding of the data to the combobox,i wqas trying to follow the same approach to the bing of iggrid, but i am having some problems..

in my view i have got this..

@(Html.Infragistics().ComboFor(item=>item.IDCliente)

.Width("270px")
.DataSourceUrl(Url.Action("employee-combo-data"))
.ValueKey("ID")
.TextKey("Name")
.DataBind()
.Render()
)

in the controller i have this:

[ComboDataSourceAction]
[ActionName("cliente-combo-data")]
public ActionResult ComboData()
{
return View(LicenciamentoMVC.Models.ClienteModel.GetListaClientes());
}

and in my cliente class i have this:

public class ClienteModel
{
private static Cliente entity;
public static IQueryable<Cliente> GetListaClientes()
{
MvcApplication1Context db = new MvcApplication1Context();

var customers = from c in db.Clientes
orderby c.IDCliente descending
where c.Rem==0
select c;

return customers.AsQueryable<Cliente>();
}
the **error** that is giving me is:
**System.Collections.Generic.IEnumerable<'LicenciamentoMVC.Models.Cliente'> does not contain any definition for 'IDCliente'.**

What changes do i need to do, or the best way to go is instead of using entity model go for repository...
thanks in advance..

Parents
No Data
Reply
  • 4315
    Offline posted

    Hi, Hugo.

    What I can see at first glance, is that maybe your solution is missing some reference, like it's said in this forum post, or the query is not returning IDClinte for some reason. If this is not the case then it will be great to share some more information for the repository you are using or to attach the problematic sample. I'm not sure what kind of repository you are going to use, but what you need to do at the end is to convert the result from the repository to IQueryable using the AsQueryable method. 

    Thank you for using our product and I will wait for your feedback. 

    Best regards,

    Nikolay Alipiev

Children