Ad

Thursday, March 21, 2013

Modifying Profile View Bands

Here’s how to update a band’s profile and pipe network through code. Well the part I was having trouble with. You need to Get the ProfileViewBandItems and the Set the ProfileViewBandItems. If you don’t set it, then it won’t work.

ProfileViewBandItemCollection bottomBandItems = profileView.Bands.GetBottomBandItems(); 
ProfileViewBandItemCollection topBandItems = profileView.Bands.GetTopBandItems();
bottomBandItems.RemoveAll();
topBandItems.RemoveAll(); 
profileView.Bands.ImportBandSetStyle(profileBandSetId); 
bottomBandItems = profileView.Bands.GetBottomBandItems(); 
topBandItems = profileView.Bands.GetTopBandItems();

UpdateBandProfileAndDataSource(PipeNetworkObjId, prof, bottomBandItems); 
UpdateBandProfileAndDataSource(PipeNetworkObjId, prof, topBandItems);

profileView.Bands.SetBottomBandItems(bottomBandItems); 
profileView.Bands.SetTopBandItems(topBandItems);

No comments:

LinkWithin

Blog Widget by LinkWithin

Ad