Hello!
I have a web service that returns a collection of anonymous types. Here is an example of something that works for me.
But this is what I wanted to do with bolded changes in code and aspx
Could you tell me why the grid doesn't display the Name of Foo when I try the second example?
I have a web service that returns a collection of anonymous types. Here is an example of something that works for me.
var allMyFoo = (from w in fooService.GiveMeFoo()
select new
{
ID = w.ID,
Foo = w.Foo.Name
});
var myFooCount = fooService.CountMyFoo();
return new Dictionary<
string
, object> {
{"foo", allMyFoo},
{"fooCount", myFooCount}
};
in aspx...
<telerik:GridBoundColumn UniqueName="FooName" SortExpression="Foo.Name" DataField="Foo" HeaderText="Foo" DataType="System.String">
</telerik:GridBoundColumn>
var allMyFoo = (from w in fooService.GiveMeFoo()
select new
{
ID = w.ID,
Foo = new { Name = w.Foo.Name }
});
var myFooCount = fooService.CountMyFoo();
return new Dictionary<
string
, object> {
{"foo", allMyFoo},
{"fooCount", myFooCount}
};
in aspx...
<
telerik:GridBoundColumn
UniqueName
=
"FooName"
SortExpression
=
"Foo.Name"
DataField
=
"Foo.Name"
HeaderText
=
"Foo"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
Could you tell me why the grid doesn't display the Name of Foo when I try the second example?