I have an anonymous linq query that I bind to a datagrid, when I debug it brings alright the data but it doesn’t show in the datagrid, I suspect that the request to RIA services isn’t completed before I bound it to the datagrid. I could use the LoadOperation<>() Completed event. But it only works with Defined Entities so how can I do that?
For reference here is the last post:
LINQ query null reference exception
Here is the query:
var bPermisos = from b in ruc.Permisos
where b.IdUsuario == SelCu.Id
select new {
Id=b.Id,
IdUsuario=b.IdUsuario,
IdPerfil=b.IdPerfil,
Estatus=b.Estatus,
Perfil=b.Cat_Perfil.Nombre,
Sis=b.Cat_Perfil.Cat_Sistema.Nombre
};
I’m a totally newbie sorry if is a very simple question.
Thanks!!
Silverlight 3 doesn’t support data binding to anonymous types.
You need to create a simple class to put your properties into.
Here is the ValueConverter technique:
Then you put this in your UserControl.Resources:
And this where you want to use a named parameter – pass it in with the ConverterParameter: