This question is locked. New answers and comments are not allowed.
Hello,
I'm adding items at run-time to a RadListBox. Some of the items need to be aligned to the left and others to the right.
For the items that need to be aligned to the right, I've tried the following methods:
item.TextAlignment = ContentAlignment.TopRight;
item.StringAlignment = StringAlignment.Far;
TextPrimitive primitive = (TextPrimitive)item.Children[2].Children[1].Children[0];
primitive.PaintTextFormat.LineAlignment = StringAlignment.Far;
primitive.Alignment = ContentAlignment.TopRight;
primitive.StringAlignment = StringAlignment.Far;
primitive.TextFormatFlags = TextFormatFlags.Right;
And some other variations. But none of them work. At best, I get the text pushed a bit to the right: the longer the text string the further right it's pushed. That is, I get the following:
abc
asdfghjk
fdfhjsgkljshgadkjhsalkdhas
Any way to get the alignment to work right?
Thanks!
I'm adding items at run-time to a RadListBox. Some of the items need to be aligned to the left and others to the right.
For the items that need to be aligned to the right, I've tried the following methods:
item.TextAlignment = ContentAlignment.TopRight;
item.StringAlignment = StringAlignment.Far;
TextPrimitive primitive = (TextPrimitive)item.Children[2].Children[1].Children[0];
primitive.PaintTextFormat.LineAlignment = StringAlignment.Far;
primitive.Alignment = ContentAlignment.TopRight;
primitive.StringAlignment = StringAlignment.Far;
primitive.TextFormatFlags = TextFormatFlags.Right;
And some other variations. But none of them work. At best, I get the text pushed a bit to the right: the longer the text string the further right it's pushed. That is, I get the following:
abc
asdfghjk
fdfhjsgkljshgadkjhsalkdhas
Any way to get the alignment to work right?
Thanks!