Text alignment problem in node

I’m having trouble getting text to align in a node in the middle center position. I’ve tried some solutions posted in the forum (such as creating a text object, setting its properties and adding it to the node), which were successful in proper alignment, but disabled the wrapping that I need. The code below is a simple implementation I’m trying, but the result is that the text is top centered, not middle centered (but at least the wrapping works). The nodes are being added to a GoPalette, if that makes any difference. Any help would be appreciated
DataView dataView = (DataView)sqlDataSourcePalette.Select(DataSourceSelectArguments.Empty);
foreach (DataRow row in dataView.Table.Rows)
{
GoTextNode node = new GoTextNode();
node.Text = row[“Name”].ToString();
node.Label.FontSize = 8.0F;
node.Label.Wrapping = true;
node.Label.Width = 75.0F;
node.Label.Height = 50.0F;
node.Label.Alignment = GoObject.MiddleCenter;
node.AutoRescales = false;
node.AutoResizes = false;
node.ToolTipText = row[“Description”].ToString();
node.Location = new PointF(xPos, yPos);
xPos += 100F;
goPalette.Document.Add(node);
}

Your code looked OK to me, so I tried it, and it worked fine.
BTW, setting GoTextNode.AutoRescales has no effect, unless that node is part of a GoGroup that is resized. (And GoText.AutoRescales is already false, by default, so that resizing a node doesn’t automatically scale the label.) But that assignment probably does no harm.

Thanks. On my system it still gives top-centered text, and I can’t figure out why. I’ll move on but continue to re-examine this issue.
Thanks for the other tips.

We have same problem adding GoText to a GoGroupList. The text is always at the top of the GoText. Changing alignment only ever effects horozontal placement. Vertically text is always at top.
Try GoObject.MiddleCenter when label.height = 22 and font is ‘MS Sans Serif’ and label.fontsize = 10.

Yes, that’s true – GoText.Alignment only specifies horizontal alignment. That’s always been the case, since GDI+/System.Drawing text drawing only supports horizontal alignment. Implementing support for vertical alignment has always been on the list of things to do some day, although it can be inefficient when considering wrapping, multilines, and trimming. (It would be easy of course in the simple cases.)
Nevertheless, vertical centering should happen automatically with GoTextNode. That’s because the vertical and horizontal positioning of the Label is specified by the TopLeftMargin and BottomRightMargin properties. (And it’s even more true for GoBasicNode when .LabelSpot is Middle, since GoBasicNode doesn’t let you specify different values for the top and the bottom margins.)