Dec 30, 2008, 5:33 AM
AnchorLayout.Controls position bug
Hi,
If you add Anchor to AnchorLayout with Items set, anchorlayout does not return the control position correct.
If you add Anchor to AnchorLayout with Items set, anchorlayout does not return the control position correct.
void AddWidgetToAnchorLayout(Portlet w, AnchorLayout layout, int position)
{
Anchor an = new Anchor();
an.Horizontal = "100%";
an.Items.Add(w);
if (position > layout.Controls.Count)
position = layout.Controls.Count;
if (position >= 0)
{
layout.Anchors.Insert(position, an);
if (layout.Controls.IndexOf(w) != position)
{
//*layout.Controls.IndexOf(w) always returns the last index. It should (does in V0.6) return position. }
}
else
{
layout.Anchors.Add(an);
}
}
Kind regards.