Custom TextBox and DataView format

Hi All,

Does anybody knows if it is possible to “format” custom TextBox fields and custom Dataview columns, for example: Text Alignment centered or to the right?

Best Regards.

myTextBox.Appearance.TextHAlign = HAlign.Center;

and if you get errors you will need

using Infragistics.Win;

3 Likes

Thank you Bernie… that worked perfectly for the textboxes!! should you know how to center, for example, the info in a Dataview column?

I think it’s this, In your grid initialize event change the layout of the grid

        {
            YourGrid.DisplayLayout.Override.CellAppearance.TextHAlign = HAlign.Center;
          
        }

Note this affects ALL cells, you can target individual cells as well. You should throw Bernie a marked solution when you get a chance.

You can do individual cells using something like this

grd.DisplayLayout.Bands[0].Columns["COLUMN NAME"].CellAppearance.TextHAlign = HAlign.Center;
1 Like