tags:

views:

113

answers:

1

I am adding BDC List Web Part programmaticaly in the Sharepoint. I want to edit view using code too. Like "Retriever items that meet these criteria" and allow Paging...I tried to do using following code...

  BusinessDataListWebPart consumer = new BusinessDataListWebPart();

         consumer.View.AllowPaging = true;
         consumer.View.AllowUserQueries = false; 
         consumer.View.QueryValues = "Project1"; 
         consumer.View.FilterValues = "PRoject1";

On msdn it says View.QueryValues Property (Microsoft.SharePoint.Portal.WebControls) and View.FilterValues Property (Microsoft.SharePoint.Portal.WebControls) This member is reserved for internal use and is not intended to be used directly from your code.

Anyone know how to do this?

A: 

My answer to this is to roll your own BusinessDataListWebPart. What I mean is to modify your WP in SharePoint and then export the wp (actually the xml) out to Visual Studio. Then use a feature to add that modified xml (the new WP) to your enviroment.

More info: http://www.sharepointnutsandbolts.com/2007/05/deploying-web-parts-as-feature.html

Johan Leino