Eval displays incorrect data from CslaDataSource

Eval displays incorrect data from CslaDataSource

Old forum URL: forums.lhotka.net/forums/t/6092.aspx


gidzone posted on Tuesday, January 06, 2009

I am using two different CslaDataDataSourcson my page in order to display data.  The CslaDataSource A (CDS-A) displays data from the rootobject while CslaDataSource B (CDS-B) displays data from a child collection of the root object.

When the page does a postback in order to display the view with the data from CDS-B, the Eval("fieldname") seems to display the data from CDS-A.

Should I be using Container.DataItem instead, or is this a deeper issue?

Thanks!

-sanjay

gidzone replied on Tuesday, January 06, 2009

My composite server control that was causing the postback was adding my controls to the page after my on change event was firing.  So, when I tried to manually call a .DataBind() on the ListViews that were displaying the data in order to trigger the OnSelect event, there was no INamingContainer to bind to it.  This resulted in an exception.

I switched the order of somethings around in the server controls I can now call a .DataBind() to fire the OnSelect event of the CslaDataSource control.

Thanks!

-sanjay

Copyright (c) Marimer LLC