Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
385
ObjectDataSource and WebGrid
posted

Has anyone managed to get their WebGrid to pull data from an ObjectDataSource that they've created in code?

I was able to drag and drop an ObjectDataSource onto my form, configure it, hook it up to a WebGrid, and everything worked fine.  Using the component breaks my application's object model, however, so I decided to create an identical ObjectDatasource in code. 

I have searched the forums & knowledge base, and tried every permutation I can think of to get this thing working.  I built a new ObjectDataSource object in the Page_Load event, and assigned the WebGrid's datasource in the WebGrid's InitializeDataSource event.

The result is always  "No Data To Display".

I'd greatly appreciate any thoughts anyone might have about this.