Home › Forums › WinForms controls › Xceed Grid for WinForms › Text alignment with a Masked Text Box
I have a small problem. I’m trying to get what is displayed in a masked text box to align to the right. The code below “should” do it, but it only aligns the text to the right when the field is edited.
c = this.gcProducts.Columns[“LeadTime”];c.Title = “Lead Time”;c.CanBeGrouped = true;c.Width = 100;
GridMaskedTextBox maskedTextBox = new GridMaskedTextBox();c.CellEditor = maskedTextBox;c.CellViewer = maskedTextBox;maskedTextBox.Mask = @”9999999 \D\a\y\s”;maskedTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
Imported from legacy forums. Posted by Peter (had 2063 views)
What you can do is set the <a href=”http://doc.xceedsoft.com/products/gridNet/ref/xceed.grid.gridelement.horizontalalignment.html”>HorizontalAlignment</a> property of the column (or cell) to <a href=”http://doc.xceedsoft.com/products/gridNet/ref/xceed.grid.horizontalalignment.html”>Xceed.Grid.HorizontalAlignment.Right</a>
Imported from legacy forums. Posted by Jenny [Xceed] (had 3230 views)