SortedBindingList and CSLADataSource problem!

SortedBindingList and CSLADataSource problem!

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


david.wendelken posted on Thursday, August 24, 2006

I set up some programs using GridViews and used the designer view to layout the grids.

Then I learned how to do sorting and added that to the code-behind page.

Everything runs fine.

But, I went into the designer and the GridView won't render properly in the designer.

I believe it has to do with the fact that the Select routine now returns a SortedBindingList<ThingInfo> instead of a ThingInfoList.

Here's the text that shows up in the rendered GridView in the designer:

There was an error rendering the control.

Unable to cast transparent proxy to type 'Csla.Web.Design.TypeLoader.

 

RockfordLhotka replied on Thursday, August 24, 2006

The TypeLoader is part of CslaDataSource, and it is used to load type information in a temporary appdomain during the design process. That exception almost certainly indicates that VS is using a different version of CSLA from your project... This can happen if you update your CSLA version (like running through the various versions of 2.1 or something).

What you need to is the following (or some subset - but this is what I do):
  1. Remove ALL Csla.dll items from your toolbox in VS
  2. Do a Rebuild All of your solution
  3. Close all designers in VS
  4. Close VS
  5. Open VS
  6. Open your solution
  7. Add the current Csla.dll to your toolbox
  8. Do a Rebuild All of your solution
I'm guessing you don't really need to do all those steps - but I have found that doing this sequence of steps always gets VS and your project running the same version of Csla.dll.

I have to do this a lot, btw, because this is needed to switch between the VB and C# versions of Csla.dll as well... VS has no way to load an assembly of the same name at the same time, so I have to do this to switch between testing/developing with each version of the framework.

david.wendelken replied on Sunday, August 27, 2006

worked like a charm!  thanks!

Copyright (c) Marimer LLC