Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a webapi which sends me a JSON result. This result is mapped to a list of objects (Employee).
In my ASP.NET GridView I do:

C#
werknemer = new DataCollector.WerknemerRepository();

                grdPersoneel.DataSource = werknemer.Get();
                grdPersoneel.DataBind();


(translation: werknemer = employee. Personeel = employees)

But on grdPersoneel.DataBind(); I get the message:
The data source for the GridView with id grdPersoneel had no features or details that columns could be generated. Make sure the data source has content.


The grdPersoneel.DataSource claims is has the 241 available rows, just likt the List<> in the result of werknemer.Get(). Why it does not databind and how to get the data bind?
Posted
Updated 24-Jun-15 0:30am
v2

1 solution

Well... pretty simple.
If you don't use get; set; on your properties the gridView does not know what to bind.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900