Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a web project which I decided to develop in an n-tier fashion.

While the project is heavily based on GridViews I use ObjectDataSources which I link with my custom managers and link those data sources to my grid views. Evertyhing was OK until now:

When I set the data source of a grid view with one of my object data source the columns are not populated anymore.

Forgive my inadequate English, so let me explain with an example:

I have table with columns A, B, C with types x, y, z. Normally, when I bind my object data source to my grid view, the view is updated and I get a column grid view with A of type x, B of type y, C of type z etc. This is the way visual studio works on design time.

Until now this was the case bu now I only get Unbounded Col1, Unbounded Col etc.

I have tried everything, googled, restart etc. but nothing changed.

Best regards.
Posted

So the columns appear, but the data does not ? Have you checked properties like the auto assign columns ? Have you tried manually assigning a template for your grid ?
 
Share this answer
 
Thanks for your reply.

Yes I have checked all properties. I also have working grids and sources, I am halfway on my project.

So I also tried to add a new grid view with an already working data source but again it fails.

Maybe I have forgotten an open bracet or something like that in one of my pages' html coding. Will something like that cause such a problem?

By the way the application is working with no errors.
 
Share this answer
 
Check if Autogenerate columns is set to true.
 
Share this answer
 
@Priya, thanks for your reply.

Yes I am sure that Auto-Generate Columns is set to true.

The problem, and also the big weirdness is that it was working but it is not working now.

When I use a datasource on my grid view the grids columns was automatically updated on design time. So I didn't have the write all those columns with hand. They were simply generated.

Let me explain it with a picture: http://i30.tinypic.com/24lslkj.jpg[^]

As you can see I have an Object Data Source with name odsUsers and a DataGrid using odsUsers as its data source. The columns are generated automatically.

After the "weirdness" I tried to add another grid to the same page with same properties using the same data source to assure that the problem is not with my new grids nor my new object data sources. As you can see the secon grid's columns are not generated.

This is really annoying.. X|
 
Share this answer
 
v2

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