Jose,
I use a *HACK* to do it in .NET V1.1
Subclass DataGridColumnS tyle and then override its
Alignment and Paint methods
If it's painting a cell you should use the intended aligment.
If it's *not* painting a cell, then it's supposedly painting
the column header, then you should use Center aligment.
<code>
Public Overrides Property Alignment() As
System.Windows. Forms.Horizonta lAlignment
Get
If _painting Then
Return MyBase.Alignmen t ' = intended alignment
Else
'probly painting header?
Return HorizontalAlign ment.Center
End If
End Get
Set(ByVal value As System.Windows. Forms.Horizonta lAlignment)
MyBase.Alignmen t = value
End Set
End Property
Protected Overloads Overrides Sub Paint( ... )
_painting = True
MyBase.Paint( ... )
_painting = False
End Sub
</code>
HTH,
Marius.
"Jose" <jo********@uni ca.com> wrote in message
news:uP******** ******@TK2MSFTN GP04.phx.gbl...
Please como center a datagrid header and the data justify to right?
Thanks a lot