Custom TextBox and DataView format


(Rubén Corral Yruretagoyena) #1

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.

(Bernie Walker) #2

myTextBox.Appearance.TextHAlign = HAlign.Center;

and if you get errors you will need

using Infragistics.Win;

(Rubén Corral Yruretagoyena) #3

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

(Chris Conn) #4

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.

(Dan Edwards) #5

You can do individual cells using something like this

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