I have a class: PeopleService that returns IQueryable list of People
This is the script that I am using:
Here is the url view source of my read:
My grid is not returning data: What am I missing?
public class PeopleService
{
List<
Person
> people = new List<
Person
>()
{
new Person(50, "Fred"),
new Person(30, "John"),
new Person(26, "Andrew"),
new Person(24, "Xaier"),
new Person(5, "Mark"),
new Person(6, "Cameron"),
};
public IQueryable<
Person
> People
{
get { return people.AsQueryable<
Person
>(); }
}
}
This is the script that I am using:
<script>
var
myDataSource = {
type:
"odata"
,
transport:
{
read:
"http://localhost:56626/WcfDataService1.svc/People"
}
};
$(document).ready(
function
() {
$(
"#grid"
).kendoGrid({
dataSource: myDataSource,
height: 500,
columns: [
"Age"
,
"Name"
]
});
});
</script>
Here is the url view source of my read:
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
standalone
=
"yes"
?>
<
feed
xml:base
=
"http://localhost:56626/WcfDataService1.svc/"
xmlns:d
=
"http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns
=
"http://www.w3.org/2005/Atom"
>
<
title
type
=
"text"
>People</
title
>
<
id
>http://localhost:56626/WcfDataService1.svc/People</
id
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
link
rel
=
"self"
title
=
"People"
href
=
"People"
/>
<
entry
>
<
id
>http://localhost:56626/WcfDataService1.svc/People('Fred')</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Person"
href
=
"People('Fred')"
/>
<
category
term
=
"WebApplication1.Person"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Age
m:type
=
"Edm.Int32"
>50</
d:Age
>
<
d:Name
>Fred</
d:Name
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:56626/WcfDataService1.svc/People('John')</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Person"
href
=
"People('John')"
/>
<
category
term
=
"WebApplication1.Person"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Age
m:type
=
"Edm.Int32"
>30</
d:Age
>
<
d:Name
>John</
d:Name
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:56626/WcfDataService1.svc/People('Andrew')</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Person"
href
=
"People('Andrew')"
/>
<
category
term
=
"WebApplication1.Person"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Age
m:type
=
"Edm.Int32"
>26</
d:Age
>
<
d:Name
>Andrew</
d:Name
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:56626/WcfDataService1.svc/People('Xaier')</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Person"
href
=
"People('Xaier')"
/>
<
category
term
=
"WebApplication1.Person"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Age
m:type
=
"Edm.Int32"
>24</
d:Age
>
<
d:Name
>Xaier</
d:Name
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:56626/WcfDataService1.svc/People('Mark')</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Person"
href
=
"People('Mark')"
/>
<
category
term
=
"WebApplication1.Person"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Age
m:type
=
"Edm.Int32"
>5</
d:Age
>
<
d:Name
>Mark</
d:Name
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:56626/WcfDataService1.svc/People('Cameron')</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-04-27T15:18:58Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Person"
href
=
"People('Cameron')"
/>
<
category
term
=
"WebApplication1.Person"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Age
m:type
=
"Edm.Int32"
>6</
d:Age
>
<
d:Name
>Cameron</
d:Name
>
</
m:properties
>
</
content
>
</
entry
>
</
feed
>
My grid is not returning data: What am I missing?