Hello,
I'm trying to programmatically move a module within a pane upon addition of another module to that same pane. Basically the functionality you find in the Module Menu under Move (e.g. Move -> Top, Move -> Up, Move -> Down, Move -> Bottom).
Ultimately, I want a specific module to always move to the bottom of the pane it is in, no matter how many modules are added to the pane. In other words, if I have a moduleA, moduleB and moduleAlwaysAtBottom and I add moduleC, I want to move moduleAlwaysAtBottom when moduleC is added such that when the page refreshes I see moduleA, moduleB, moduleC, moduleAlwaysAtBottom within the pane.
I don't want to add moduleC to the bottom and then manually move it up or move moduleAlwaysAtBottom down.
I've found the ModuleInfo.ModuleOrder is used in the ControlPanel to set whether an added module is added at the top (<> -1) or the bottom (=-1). However, changing the ModuleOrder has not worked for me. Example; I have moduleA and moduleB in the same pane. Module A has a ModuleOrder value of 1. On a button_click event in moduleA I set moduleA's ModuleOrder to -1. This does NOT move it to the bottom as I expected from the ContentPanel Code. In fact, it has no impact at all.
I've looked in the object browser for clues. I see in the Object Browser that there are constants for these values (DotNetNuke.Entities.Modules.Actions.ModuleActionType) but don't see how to use them.
I've tried to use the ModuleController object method MoveModule but its method signature suggests it is for moving modules from tab to tab, not changing their order within a pane.
Thanks for any help,
Jorge
Environment:
DotNetNuke 4.0, VWD 2005, SQL Server Express 2005