Hello,
Your approach with using RenderedHTML is good, however the algorithm should look rather like following one (well, in fact your can add whatever code which will work well for you). Please add following code to
OnPreRender method:
this.menuElem.RenderedHTML = this.menuElem.RenderedHTML.Replace("menuElem_UL_1", "menu4"); // replace appropriate string pattern
this.menuElem.LoadDataAutomaticaly = false; //prevent to reload the menu
Please note, it is still an example and you may need to adjust it as per your needs.
Best regards
Ondrej Vasil