I'm trying to get a handle on barItems so I can change their visible property. mainFrameBarManagerRT.GetBarItemFromBarItemID always returns a null reference. Here's the code (rmir.BarItemID is a string holding the value of a BarItem's ID property):
if (rmir.Visible == true)
BarItemID id = new BarItemID();
id.barItemID = rmir.BarItemID;
BarItem bi = mainFrameBarManagerRT.GetBarItemFromBarItemID(id);
if (bi != null)
bi.Visible = true;
Is this method supposed to find a BarItem object based on the string value? Is there a better way to search for a specific BarItem object based on its ID?